iconm-menu
English chevron-down
中文EnglishРусский
moon-outline
light

openEuler Installation Using virt-install

sigui small_leek2020-10-26openEuler installation

Installation Procedure (AArch64)

Environment Information

  1. Host environment: openEuler release 20.09

  2. Virtual machine (VM) ISO: openEuler-20.09-aarch64-dvd.iso

  3. ISO file download address:
    https://repo.openeuler.org/openEuler-20.09/ISO/aarch64/openEuler-20.09-aarch64-dvd.iso

Preparations

  1. Obtain the ISO file, install VM-related components libvirt, qemu, and virt-install on the host, and enable the libvirtd service.

     yum install –y libvirt*
     yum install –y qemu*
     yum install –y virt-install
     systemctl start libvirtd
    
  2. Install edk2.

     yum install –y edk2
    

Install VNC Viewer on a Windows machine or a machine that can connect to the host and has a graphical user interface (GUI), and set VNC client options.

GUI-based Installation

  1. Run the following command to use VNC for installation:
virt-install --connect qemu:///system --virt-tpye kvm --vcpus [cpu_num] --memory [memory size] --name [domain name] --cdrom [iso_path] --disk [disk_path_and_parameter] --boot cdrom --network [network] --graphics vnc,listen=0.0.0.0

Example:

virt-install --connect qemu:///system --virt-tpye kvm --vcpus 4 --memory 4096 --name sgs-oe-20.09 --cdrom /home/images/openEuler-20.09-aarch64-dvd.iso --disk path=/home/images/test.img,size=50,format=qcow2,bus=scsi --boot cdrom --network network=default --graphics vnc,listen=0.0.0.0
  1. Start another terminal and run the following command to check the VNC port number:
virsh vncdisplay [domain name]
  1. Open VNC Viewer and input [host name:port number] to connect to the host. The following figure is an example.

Note: If the connection fails, run the following commands on the host to enable the port:

firewall-cmd --add-port=[port]/tcp
firewall-cmd --add-port=[port]/tcp --permanent

The value of [port] should be the sum of 5900 plus the port number. For example:

firewall-cmd --add-port=5903/tcp
firewall-cmd --add-port=5903/tcp --permanent

Select Install or Test & Install. The following screen is displayed.

Click Continue.

Complete items marked with ! and then click Begin Installation.

Restart the host after the installation is complete.
  1. The startup mode is set to boot during the installation. After the installation is complete and the system is restarted, the following interface is displayed. Input exit to exit the console.
  1. Go to the BIOS screen, select Boot Manager > UEFI QEMU QEMU HARDDISK as the system boot mode.
  1. Restart the system. The installation is complete.

CLI–based Installation

  1. Run the following command to use VNC for installation:
virt-install --connect qemu:///system --virt-tpye kvm --vcpus [cpu_num] --memory [memory size] --name [domain name] --cdrom [iso_path] --disk [disk_path_and_parameter] --boot cdrom --network [network]

Example:

virt-install --connect qemu:///system --virt-tpye kvm --vcpus 4 --memory 4096 --name wx-oe-20.09 --cdrom /home/images/openEuler-20.09-aarch64-dvd.iso --disk path=/home/images/test.img,size=50,format=qcow2,bus=scsi --boot cdrom --network network=default
  1. Type e to enter the edit mode.

Modify the console. Set console=ttyAMA0,115200,tty0.

After the modification, press Ctrl and X to start the installation.

  1. Select 2) Use text mode.
  1. The installation starts. Items marked with ! need to be customized.

Type r to refresh the status of items under processing.



  1. Set the password of the root user.
  1. After the preceding settings are complete, type b to start the installation.
  1. The startup mode is set to boot during the installation. After the installation is complete and the system is restarted, the following interface is displayed. Input exit to exit the console.
  1. Go to the BIOS screen, select Boot Manager > UEFI QEMU QEMU HARDDISK as the system boot mode.
  1. Restart the system. The installation is complete.

Installation Procedure (x86_64)

Environment Information

  1. Host environment: openEuler release 20.09
  2. VM ISO: openEuler-20.09-x86_64-dvd.iso
  3. ISO file download address:
    https://repo.openeuler.org/openEuler-20.09/ISO/x86_64/openEuler-20.09-x86_64-dvd.iso

Preparations

  1. Obtain the ISO file, install VM-related components libvirt, qemu, and virt-install on the host, and enable the libvirtd service.

     yum install –y libvirt*
     yum install –y qemu*
     yum install –y virt-install
     systemctl start libvirtd
    
  2. Install edk2.

     yum install –y edk2
    
  3. Install VNC Viewer on a Windows terminal or a terminal that can connect to the host and has a graphical user interface (GUI), and set VNC client options.

GUI-based Installation

  1. Run the following command to use VNC for installation:
virt-install --connect qemu:///system --vcpus [cpu_num] --memory [memory size] --name [domain name] --cdrom [iso_path] --disk [disk_path_and_parameter] --boot cdrom --network [network] --graphics vnc,listen=0.0.0.0

Example:

virt-install --connect qemu:///system --vcpus 4 --memory 4096 --name wx-oe-20.09 --cdrom /home/images/openEuler-20.09-x86_64-dvd.iso --disk path=/home/images/test.img,size=50,format=qcow2,bus=virtio --video virtio --boot cdrom --network network=default --graphics vnc,listen=0.0.0.0
  1. Start another terminal and run the following command to check the VNC port number:

     virsh vncdisplay [domain name]
    
  2. Open VNC Viewer and input [host name:port number] to connect to the host. The following figure is an example.

Note: If the connection fails, run the following commands on the host to enable the port:

    firewall-cmd --add-port=[port]/tcp
    firewall-cmd --add-port=[port]/tcp --permanent

The value of [port] should be the sum of 5900 plus the port number. For example:

    firewall-cmd --add-port=5903/tcp
    firewall-cmd --add-port=5903/tcp --permanent
  1. Select Install or Test & Install. The following screen is displayed.
Click **Continue**. Complete items marked with ! and then click **Begin Installation**. Restart the host after the installation is complete.
  1. Start another terminal and shut down the newly installed VM.

     virsh destroy [domain name]
    
  2. Change the VM boot mode from boot dev='cdrom' to boot dev='hd'.

     virsh edit [domain name]
    
  3. Restart the VM.

     virsh start [domain name]
    
  4. Use VNC Viewer to connect to the VM again and ensure that the VM is restarted successfully.


[Disclaimer] This article only represents the author's opinions, and is irrelevant to this website. This website is neutral in terms of the statements and opinions in this article, and does not provide any express or implied warranty of accuracy, reliability, or completeness of the contents contained therein. This article is for readers' reference only, and all legal responsibilities arising therefrom are borne by the reader himself.