API Doc
Search Docs...
⌘ K
VM Initialization ToolArcfra VMToolsArcfra CloudMoveArcfra Data Protection AdapterMigration Tool

Operation guide for Linux virtual machines

Prerequisite

  • For virtual machines using Linux VirtIO drivers, the kernel version must be 2.6.24 or later.
  • Ensure that all anti-virus or intrusion detection software is disabled. If needed, you can enable them after the drivers are installed.
  • Ensure that the bus type of all disks is set to IDE. If there are disks with a bus other than IDE, refer to step 1 to 3 in Operation guide for Windows virtual machines for related operations.

Prerequisite

  • The operating system should meet the following requirements:
    • CentOS: Version 6.0 or later.
    • Red Hat: Version 6.0 or later.
    • Oracle Linux: Version 6.0 or later.
  • Check the initial root filesystem name in the boot directory to determine whether the filesystem is initramfs or initrd.

Procedure

  1. Run vi /etc/dracut.conf to open the /etc/dracut.conf file.

  2. Press i to switch to the insert mode, and then edit as follows to add VirtIO drivers to the add_drivers item. You can adjust the command format according to the actual system requirements.

    [root@localhost ~]# vi /etc/dracut.conf 
    # additional kernel modules to the default 
    add_drivers+="virtio_blk virtio_scsi virtio_net virtio_pci virtio_ring virtio" 

    Note:

  3. Press Esc, enter :wq, and then press Enter. The system will save the change and exit the /etc/dracut.conf file.

  4. Run the following command to regenerate initrd:

    dracut -f /boot/initramfs-`uname -r`.img

    Note:

    The symbols on both sides of uname -r in the command are backquotes (`).

    If the initial root filesystem is not the default initramfs, run the following command instead:

    dracut -f <name>

    Replace <name> with the actual initramfs or initrd file name, which can be acquired from the grub.cfg file. You can find the grub.cfg file in the path /boot/grub/grub.cfg, /boot/grub2/grub.cfg or /boot/grub/grub.conf, depending on different operating systems.

  5. Check whether the VirtIO driver modules have been added successfully.

    • If the initial root filesystem is initramfs, run the following command:

      lsinitrd /boot/initramfs-`uname -r`.img | grep virtio
    • If the initial root filesystem is initrd, run the following command:

      lsinitrd /boot/initrd-`uname -r` | grep virtio

    Taking the initramfs filesystem as an example, the output will be:

    [root@localhost ~]# lsinitrd /boot/initramfs-`uname -r`.img | grep virtio 
    -rwxr--r--   1 root     root        23448 Nov 1 10:58 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/block/virtio_blk.ko 
    -rwxr--r--   1 root     root        50704 Nov 1 10:58 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/net/virtio_net.ko 
    -rwxr--r--   1 root     root        28424 Nov 1 10:58 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/scsi/virtio_scsi.ko 
    drwxr-xr-x   2 root     root            0 Nov 1 10:58 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/virtio 
    -rwxr--r--   1 root     root        14544 Nov 1 10:58 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/virtio/virtio.ko 
    -rwxr--r--   1 root     root        21040 Nov 1 10:58 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/virtio/virtio_pci.ko 
    -rwxr--r--   1 root     root        18016 Nov 1 10:58 lib/modules/2.6.32-573.8.1.el6.x86_64/kernel/drivers/virtio/virtio_ring.ko        

    Note that the above output is only an example. If there are virtio_net, virtio_blk and virtio_scsi modules in the output, then all VirtIO driver modules have been added successfully.

  6. Shut down the virtual machine, and set both its bus type and NIC mode to VIRTIO, and then reboot it. Once finished, try accessing the operating system. If the access is successful, then all the VirtIO drivers have been installed.

Operation guide for Ubuntu or Debian virtual machines

Prerequisite

The operating system should meet the following requirements:

  • Ubuntu: Version 18.04 or later.
  • Debian: Version 9.0 or later.

Procedure

  1. Run vi /etc/initramfs-tools/modules to open the /etc/initramfs-tools/modules file.

  2. Press i to switch to the insert mode, and edit as follows to add VirtIO drivers. You can adjust the command format according to the actual system requirements.

    [root@localhost ~]#vi /etc/initramfs-tools/modules 
    …… 
    # Examples: 
    # 
    # raid1 
    # sd_mOd 
    virtio_blk
    virtio_scsi
    virtio_net
    virtio_pci
    virtio_ring
    virtio
  3. Press Esc, enter :wq, and then press Enter. The system will save the change and exit the /etc/initramfs-tools/modules file.

  4. Run update-initramfs -u to regenerate initrd.

  5. Run the following command to check whether VirtIO driver modules have been added successfully:

    lsinitramfs /boot/initrd.img-`uname -r` |grep virtio

    Note:

    The symbols on both sides of uname -r in the command are backquotes (`).

    If successful, the output will be:

    [root@localhost ~]# lsinitramfs /boot/initrd.img-`uname -r` |grep virtio 
    -rwxr--r-- 1 root root 19248 Jun 22 2012 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/scsi/virtio_scsi.ko
    -rwxr--r-- 1 root root 23856 Jun 22 2012 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/block/virtio_blk.ko
    drwxr-xr-x 2 root root 0 Jul 12 14:53 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/virtio
    -rwxr--r-- 1 root root 15848 Jun 22 2012 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/virtio/virtio_ring.ko
    -rwxr--r-- 1 root root 20008 Jun 22 2012 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/virtio/virtio_pci.ko
    -rwxr--r-- 1 root root 12272 Jun 22 2012 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/virtio/virtio.ko
    -rwxr--r-- 1 root root 38208 Jun 22 2012 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/net/virtio_net.ko

    Note that the above output is only an example. If there are virtio_net, virtio_blk and virtio_scsi modules in the output, then all VirtIO driver modules have been added successfully.

  6. Shut down the virtual machine, and set both its bus type and NIC mode to VIRTIO, and then reboot it. Once finished, try accessing the operating system. If the access is successful, then all the VirtIO drivers have been installed.

Operation guide for SUSE or openSUSE virtual machines

Prerequisite

  • The SUSE or openSUSE system is of version 11 or later.
  • Check the initial root filesystem name in the boot directory to determine whether the filesystem is initramfs or initrd.

For system versions earlier than SUSE 12 SP1 or openSUSE 13

  1. Run vi /etc/sysconfig/kernel to open the /etc/sysconfig/kernel file.

  2. Press i to switch to the insert mode, and edit as follows to add VirtIO drivers to INITRD_MODULES item. You can adjust the command format according to the actual system requirements. Once finished, save the change and exit the file.

    [root@localhost ~]# vi /etc/sysconfig/kernel 
    # (like drivers for scsi-controllers, for lvm or reiserfs)
    #
    INITRD_MODULES="ata_piix ata_generic virtio_blk virtio_scsi virtio_net virtio_pci virtio_ring virtio"
  3. Press Esc, enter :wq, and then press Enter. The system will save the change and exit the /etc/sysconfig/kernel file.

  4. Run mkinitrd to regenerate initrd.

    Note:

    If the initial root filesystem is not the default initramfs or initrd, run the dracut -f <Actual name of the initramfs or initrd file> command instead. You can find the menu.lst or grub.cfg file in the path /boot/grub/menu.lst, /boot/grub/grub.cfg, or /boot/grub2/grub.cfg.

    The following is an example initrd file of SUSE 11 SP4:

    default 0 
    timeout 10 
    gfxmenu (hd0,0)/boot/message 
    title sles11sp4_001_[_VMX_] 
    root (hd0,0) 
    kernel /boot/linux.vmx vga=0x314 splash=silent console=ttyS0,115200n8 console=tty0 net.ifnames=0 NON_PERSISTENT_DEVICE_NAMES=1 showopts 
    initrd /boot/initrd.vmx 
    title Failsafe_sles11sp4_001_[_VMX_] 
    root (hd0,0) 
    kernel /boot/linux.vmx vga=0x314 splash=silent ide=nodma apm=off noresume edd=off powersaved=off nohz=off highres=off processsor.max+cstate=1 nomodeset x11failsafe console=ttyS0,115200n8 console=tty0 net.ifnames=0 NON_PERSISTENT_DEVICE_NAMES=1 showopts 
    initrd /boot/initrd.vmx

    Replace the /boot/initrd.vmx in the initrd line with the initrd file actually used, that is, you should run dracut -f /boot/initrd.vmx. If the initrd file does not contain the /boot directory, such as /initramfs-xxx, you need to add the /boot directory when you run the command, that is, you should run dracut -f /boot/initramfs-xxx.

  5. Check whether the initial root filesystem has added the VirtIO driver modules successfully.

    • If the initial root filesystem is initramfs, run the following command:

      lsinitrd /boot/initramfs-`uname -r`.img | grep virtio

      Note:

      The symbols on both sides of uname -r in the command are backquotes (`).

    • If the initial root filesystem is initrd, run the following command:

      lsinitrd /boot/initrd-`uname -r` | grep virtio

    Taking the initrd filesystem as an example, the output will be:

    [root@localhost ~]# lsinitrd /boot/initrd-`uname -r` | grep virtio
    -rwxr--r-- 1 root root 19248 Jun 22 2012 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/scsi/virtio_scsi.ko
    -rwxr--r-- 1 root root 23856 Jun 22 2012 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/block/virtio_blk.ko
    drwxr-xr-x 2 root root 0 Jul 12 14:53 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/virtio
    -rwxr--r-- 1 root root 15848 Jun 22 2012 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/virtio/virtio_ring.ko
    -rwxr--r-- 1 root root 20008 Jun 22 2012 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/virtio/virtio_pci.ko
    -rwxr--r-- 1 root root 12272 Jun 22 2012 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/virtio/virtio.ko
    -rwxr--r-- 1 root root 38208 Jun 22 2012 lib/modules/2.6.32-279.el6.x86_64/kernel/drivers/net/virtio_net.ko

    Note that the above output is only an example. If there are virtio_net, virtio_blk and virtio_scsi modules in the output, then all VirtIO driver modules have been added successfully.

  6. Shut down the virtual machine, and set both its bus type and NIC mode to VIRTIO, and then reboot it. Once finished, try accessing the operating system. If the access is successful, then all the VirtIO drivers have been installed.

For SUSE 12 SP1

  1. Run vi /etc/dracut.conf to open the /etc/dracut.conf file.

  2. Press i to switch to the insert mode, and edit as follows to add VirtIO drivers to add_drivers. You can adjust the command format according to the actual system requirements.

    [root@localhost ~]# vi /etc/dracut.conf 
    # additional kernel modules to the default
    add_drivers+="ata_piix ata_generic virtio_blk virtio_scsi virtio_net virtio_pci virtio_ring virtio"
  3. Press Esc, enter :wq, and then press Enter. The system will save the change and exit the /etc/dracut.conf file.

  4. Run the following command to regenerate initrd.

    dracut -f /boot/initramfs-`uname -r`.img

    Note:

    The symbols on both sides of uname -r in the command are backquotes (`).

    If the initial root filesystem is not the default initramfs, run the following command instead:

    dracut -f <name>

    Replace <name> with the actual initramfs or initrd file name, which can be acquired from the grub.cfg file. You can find the grub.cfg file in the path /boot/grub/grub.cfg, /boot/grub2/grub.cfg or /boot/grub/grub.conf, depending on different operating systems.

  5. Check whether the initial root filesystem has added the VirtIO driver modules successfully.

    • If the initial root filesystem is initramfs, run the following command:

      lsinitrd /boot/initramfs-`uname -r`.img | grep virtio
    • If the initial root filesystem is initrd, run the following command:

      lsinitrd /boot/initrd-`uname -r` | grep virtio

    Taking the initrd filesystem as an example, the output will be:

    [root@localhost ~]# lsinitrd /boot/initrd-`uname -r` | grep virtio
    -rw-r--r-- 1 root root 29335 Oct 26 2016 lib/modules/4.4.21-69-default/kernel/drivers/block/virtio_blk.ko
    -rw-r--r-- 1 root root 57007 Oct 26 2016 lib/modules/4.4.21-69-default/kernel/drivers/net/virtio_net.ko
    -rw-r--r-- 1 root root 32415 Oct 26 2016 lib/modules/4.4.21-69-default/kernel/drivers/scsi/virtio_scsi.ko
    drwxr-xr-x 2 root root 0 Sep 28 10:21 lib/modules/4.4.21-69-default/kernel/drivers/virtio
    -rw-r--r-- 1 root root 19623 Oct 26 2016 lib/modules/4.4.21-69-default/kernel/drivers/virtio/virtio.ko
    -rw-r--r-- 1 root root 38943 Oct 26 2016 lib/modules/4.4.21-69-default/kernel/drivers/virtio/virtio_pci.ko
    -rw-r--r-- 1 root root 24431 Oct 26 2016 lib/modules/4.4.21-69-default/kernel/drivers/virtio/virtio_ring.ko

    Note that the above output is only an example. If there are virtio_net, virtio_blk and virtio_scsi modules in the output, then all VirtIO driver modules have been added successfully.

  6. Shut down the virtual machine, and set both its bus type and NIC mode to VIRTIO, and then reboot it. Once finished, try accessing the operating system. If the access is successful, then all the VirtIO drivers have been installed.

For system versions later than SUSE 12 SP1 or openSUSE 13

  1. Run vi /etc/dracut.conf to open the /etc/dracut.conf file.

  2. Press i to switch to the insert mode, and edit as follows to add VirtIO drivers to add_drivers. You can adjust the command format according to the actual system requirements.

    [root@localhost ~]# vi /etc/dracut.conf 
    # additional kernel modules to the default
    add_drivers+="ata_piix ata_generic virtio_blk virtio_scsi virtio_net virtio_pci virtio_ring virtio"
  3. Press Esc, enter :wq, and then press Enter. The system will save the change and exit the /etc/dracut.conf file.

  4. Run the following command to regenerate initrd.

    dracut -f /boot/initramfs-`uname -r`.img

    Note:

    The symbols on both sides of uname -r in the command are backquotes (`).

    If the initial root filesystem is not the default initramfs, run the following command instead:

    dracut -f <name>

    Replace <name> with the actual initramfs or initrd file name, which can be acquired from the grub.cfg file. You can find the grub.cfg file in the path /boot/grub/grub.cfg, /boot/grub2/grub.cfg or /boot/grub/grub.conf, depending on different operating systems.

  5. Check whether the initial root filesystem has added the VirtIO driver modules successfully.

    • If the initial root filesystem is initramfs, run the following command:

      lsinitrd /boot/initramfs-`uname -r`.img | grep virtio
    • If the initial root filesystem is initrd, run the following command:

      lsinitrd /boot/initrd-`uname -r` | grep virtio

    Taking the initrd filesystem as an example, the output will be:

    [root@localhost ~]# lsinitrd /boot/initrd-`uname -r` | grep virtio
    -rw-r--r-- 1 root root 29335 Oct 26 2016 lib/modules/4.4.21-69-default/kernel/drivers/block/virtio_blk.ko
    -rw-r--r-- 1 root root 57007 Oct 26 2016 lib/modules/4.4.21-69-default/kernel/drivers/net/virtio_net.ko
    -rw-r--r-- 1 root root 32415 Oct 26 2016 lib/modules/4.4.21-69-default/kernel/drivers/scsi/virtio_scsi.ko
    drwxr-xr-x 2 root root 0 Sep 28 10:21 lib/modules/4.4.21-69-default/kernel/drivers/virtio
    -rw-r--r-- 1 root root 19623 Oct 26 2016 lib/modules/4.4.21-69-default/kernel/drivers/virtio/virtio.ko
    -rw-r--r-- 1 root root 38943 Oct 26 2016 lib/modules/4.4.21-69-default/kernel/drivers/virtio/virtio_pci.ko
    -rw-r--r-- 1 root root 24431 Oct 26 2016 lib/modules/4.4.21-69-default/kernel/drivers/virtio/virtio_ring.ko

    Note that the above output is only an example. If there are virtio_net, virtio_blk and virtio_scsi modules in the output, then all VirtIO driver modules have been added successfully.

  6. Shut down the virtual machine, and set both its bus type and NIC mode to VIRTIO, and then reboot it. Once finished, try accessing the operating system. If the access is successful, then all the VirtIO drivers have been installed.