2019-08-05 15:33:48 +08:00
.. _using_hybrid_mode_on_nuc:
2021-02-13 08:27:24 +08:00
Getting Started Guide for ACRN Hybrid Mode
2020-04-24 20:40:35 +08:00
##########################################
2020-11-04 05:04:46 +08:00
2019-08-15 02:43:28 +08:00
ACRN hypervisor supports a hybrid scenario where the User VM (such as Zephyr
2020-08-03 08:14:42 +08:00
or Ubuntu) runs in a pre-launched VM or in a post-launched VM that is
2022-03-19 06:24:35 +08:00
launched by a Device Model in the Service VM.
2019-08-05 15:33:48 +08:00
2021-05-10 20:36:05 +08:00
.. figure :: images/ACRN-Hybrid.png
2019-08-05 15:33:48 +08:00
:align: center
2019-08-15 02:43:28 +08:00
:width: 600px
2022-06-23 17:05:42 +08:00
:name: hybrid_scenario_on_Vecow
2019-08-05 15:33:48 +08:00
2022-06-23 17:05:42 +08:00
The Hybrid Scenario on the Vecow SPC-7100
2019-08-05 15:33:48 +08:00
2020-11-04 05:04:46 +08:00
The following guidelines
2022-06-23 17:05:42 +08:00
describe how to set up the ACRN hypervisor hybrid scenario on the Vecow SPC-7100,
as shown in :numref: `hybrid_scenario_on_Vecow` .
2020-11-04 05:04:46 +08:00
2021-05-10 20:36:05 +08:00
.. note ::
2021-05-24 14:20:05 +08:00
All build operations are done directly on the target. Building the artifacts (ACRN hypervisor, kernel, tools and Zephyr)
2021-05-10 20:36:05 +08:00
on a separate development machine can be done but is not described in this document.
2020-11-04 05:04:46 +08:00
.. contents ::
:local:
:depth: 1
2021-05-10 20:36:05 +08:00
.. rst-class :: numbered-step
Set-up base installation
***** ***** ***** ***** *** *
2022-06-23 17:05:42 +08:00
- Use the `Vecow SPC-7100 <https://marketplace.intel.com/s/offering/a5b3b000000PReMAAW/vecow-spc7100-series-11th-gen-intel-core-i7i5i3-processor-ultracompact-f> `_ .
2019-08-15 02:43:28 +08:00
- Connect to the serial port as described in :ref: `Connecting to the serial port <connect_serial_port>` .
2022-06-23 17:05:42 +08:00
- Install Ubuntu 20.04 on your SATA device or on the NVME disk of your
Intel Vecow.
2019-08-05 15:33:48 +08:00
2020-11-04 05:04:46 +08:00
.. rst-class :: numbered-step
2021-05-10 20:36:05 +08:00
Prepare the Zephyr image
***** ***** ***** ***** *** *
Prepare the Zephyr kernel that you will run in VM0 later.
2021-11-13 08:23:51 +08:00
- Follow step 1 from the :ref: `using_zephyr_as_user_vm` instructions
2021-05-10 20:36:05 +08:00
2021-08-28 00:06:13 +08:00
.. note :: We only need the ELF binary Zephyr kernel, not the entire `` zephyr.img ``
2021-05-10 20:36:05 +08:00
2021-08-28 00:06:13 +08:00
- Copy the :file: `zephyr/zephyr.elf` to the `` /boot `` folder::
2021-05-10 20:36:05 +08:00
2021-08-28 00:06:13 +08:00
sudo cp zephyr/zephyr.elf /boot
2021-05-10 20:36:05 +08:00
.. rst-class :: numbered-step
Set-up ACRN on your device
***** ***** ***** ***** ***** *
2021-08-20 07:28:08 +08:00
- Follow the instructions in :Ref: `gsg` to build ACRN using the
2022-06-23 17:05:42 +08:00
`` hybrid `` scenario. Here is the build command-line for the `Vecow SPC-7100 <https://marketplace.intel.com/s/offering/a5b3b000000PReMAAW/vecow-spc7100-series-11th-gen-intel-core-i7i5i3-processor-ultracompact-f> `_ ::
2021-05-10 20:36:05 +08:00
2022-06-23 17:05:42 +08:00
make clean && make BOARD=tgl-vecow-spc-7100-Corei7 SCENARIO=hybrid
2021-05-10 20:36:05 +08:00
- Install the ACRN hypervisor and tools
.. code-block :: none
cd ~/acrn-hypervisor # Or wherever your sources are
sudo make install
sudo cp build/hypervisor/acrn.bin /boot
sudo cp build/hypervisor/acpi/ACPI_VM0.bin /boot
- Build and install the ACRN kernel
.. code-block :: none
cd ~/acrn-kernel # Or where your ACRN kernel sources are
2021-12-01 03:03:01 +08:00
cp kernel_config_service_vm .config
2021-05-10 20:36:05 +08:00
make olddefconfig
make
sudo make modules_install
sudo cp arch/x86/boot/bzImage /boot/bzImage
.. rst-class :: numbered-step
2019-08-15 02:43:28 +08:00
Update Ubuntu GRUB
***** ***** ***** ***
Perform the following to update Ubuntu GRUB so it can boot the hypervisor and load the kernel image:
#. Append the following configuration in the `` /etc/grub.d/40_custom `` file:
2019-08-05 15:33:48 +08:00
.. code-block :: bash
2020-09-15 23:47:14 +08:00
:emphasize-lines: 10,11,12
2019-08-05 15:33:48 +08:00
2020-08-03 08:14:42 +08:00
menuentry 'ACRN hypervisor Hybrid Scenario' --id ACRN_Hybrid --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-e23c76ae-b06d-4a6e-ad42-46b8eedfd7d3' {
2019-08-05 15:33:48 +08:00
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
echo 'Loading hypervisor Hybrid scenario ...'
2020-08-03 08:14:42 +08:00
multiboot2 /boot/acrn.bin
2021-08-28 00:06:13 +08:00
module2 /boot/zephyr.elf xxxxxx
2020-08-03 08:14:42 +08:00
module2 /boot/bzImage yyyyyy
2020-09-15 23:47:14 +08:00
module2 /boot/ACPI_VM0.bin ACPI_VM0
2019-08-05 15:33:48 +08:00
}
2022-03-19 06:24:35 +08:00
2021-08-28 00:06:13 +08:00
.. note :: The module `` /boot/zephyr.elf `` is the VM0 (Zephyr) kernel file.
2020-04-14 06:29:10 +08:00
The param `` xxxxxx `` is VM0's kernel file tag and must exactly match the
2022-06-23 17:05:42 +08:00
`` kern_mod `` of VM0, which is configured in the `` misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml ``
2019-08-15 02:43:28 +08:00
file. The multiboot module `` /boot/bzImage `` is the Service VM kernel
file. The param `` yyyyyy `` is the bzImage tag and must exactly match the
2022-06-23 17:05:42 +08:00
`` kern_mod `` of VM1 in the `` misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml ``
2020-09-26 07:24:35 +08:00
file. The kernel command-line arguments used to boot the Service VM are
2022-06-23 17:05:42 +08:00
`` bootargs `` of VM1 in the `` misc/config_tools/data/tgl-vecow-spc-7100-Corei7/hybrid.xml `` .
2020-09-15 23:47:14 +08:00
The module `` /boot/ACPI_VM0.bin `` is the binary of ACPI tables for pre-launched VM0 (Zephyr).
The parameter `` ACPI_VM0 `` is VM0's ACPI tag and should not be modified.
2019-08-05 15:33:48 +08:00
2021-09-22 15:28:19 +08:00
#. Correct example Grub configuration (with `` module2 `` image paths set):
.. code-block :: console
:emphasize-lines: 10,11,12
menuentry 'ACRN hypervisor Hybrid Scenario' --id ACRN_Hybrid --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-e23c76ae-b06d-4a6e-ad42-46b8eedfd7d3' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
echo 'Loading hypervisor Hybrid scenario ...'
multiboot2 /boot/acrn.bin
module2 /boot/zephyr.elf Zephyr_ElfImage
module2 /boot/bzImage Linux_bzImage
module2 /boot/ACPI_VM0.bin ACPI_VM0
2022-03-19 06:24:35 +08:00
2021-09-22 15:28:19 +08:00
}
2019-08-05 15:33:48 +08:00
#. Modify the `` /etc/default/grub `` file as follows to make the GRUB menu
visible when booting:
.. code-block :: bash
2020-08-03 08:14:42 +08:00
GRUB_DEFAULT=ACRN_Hybrid
GRUB_TIMEOUT=5
2019-08-05 15:33:48 +08:00
# GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=false
2019-08-15 02:43:28 +08:00
#. Update GRUB::
2019-08-05 15:33:48 +08:00
$ sudo update-grub
2020-09-26 07:24:35 +08:00
#. Reboot the Intel NUC. Select the **ACRN hypervisor Hybrid Scenario** entry to boot
the ACRN hypervisor on the Intel NUC's display. The GRUB loader will boot the
2019-08-15 02:43:28 +08:00
hypervisor, and the hypervisor will start the VMs automatically.
2019-08-05 15:33:48 +08:00
2020-11-04 05:04:46 +08:00
.. rst-class :: numbered-step
Hybrid Scenario Startup Check
***** ***** ***** ***** ***** *** *
2021-09-24 04:49:20 +08:00
#. Connect to the serial port as described in this :ref:`Connecting to the
serial port <connect_serial_port>` tutorial.
2021-09-22 15:28:19 +08:00
2019-08-15 02:43:28 +08:00
#. Use these steps to verify that the hypervisor is properly running:
2019-08-05 15:33:48 +08:00
2019-08-15 02:43:28 +08:00
a. Log in to the ACRN hypervisor shell from the serial console.
#. Use the vm_list command to verify that the pre-launched VM and Service VM are launched successfully.
2019-08-05 15:33:48 +08:00
#. Use these steps to verify all VMs are running properly:
2020-09-26 07:24:35 +08:00
a. Use the `` vm_console 0 `` to switch to VM0 (Zephyr) console. It will display `` Hello world! acrn `` .
2020-08-07 07:03:16 +08:00
#. Enter :kbd: `Ctrl` + :kbd: `Space` to return to the ACRN hypervisor shell.
2019-08-15 02:43:28 +08:00
#. Use the `` vm_console 1 `` command to switch to the VM1 (Service VM) console.
2020-08-20 08:42:04 +08:00
#. Verify that the VM1's Service VM can boot and you can log in.
2022-03-19 06:24:35 +08:00
#. ssh to VM1 and launch the post-launched VM2 using the ACRN Device Model launch script.
2020-08-07 07:03:16 +08:00
#. Go to the Service VM console, and enter :kbd: `Ctrl` + :kbd: `Space` to return to the ACRN hypervisor shell.
2019-08-15 02:43:28 +08:00
#. Use the `` vm_console 2 `` command to switch to the VM2 (User VM) console.
2020-08-20 08:42:04 +08:00
#. Verify that VM2 can boot and you can log in.
2019-08-15 02:43:28 +08:00
2020-04-10 05:50:30 +08:00
Refer to the :ref: `acrnshell` for more information about available commands.