Long-Term Supported Versions

    Innovation Versions

      Installation Guide

      This chapter describes the installation of openEuler using QEMU as an example. For other installation methods, refer to the installation pages for the development boards.

      Installing QEMU

      System Environment

      The environments tested so far include WSL2 (Ubuntu 20.04.4 LTS and Ubuntu 22.04.1 LTS) and Ubuntu 22.04.1 live-server LTS.

      Installing QEMU of the RISC-V Architecture

      Install the qemu-system-riscv64 package provided by the Linux distribution. openEuler 23.09 x86_64 provides QEMU 6.2.0 (qemu-system-riscv-6.2.0-80.oe2309.x86_64):

      dnf install -y qemu-system-riscv
      

      QEMU 8.0 and later versions are recommended because they provide a lot of fixes and updates for RISC-V. The following uses QEMU 8.1.2 as an example.

      Manual Compilation and Installation

      If the provided software package is outdated, you can manually compile and install QEMU.

      wget https://download.qemu.org/qemu-8.1.2.tar.xz
      tar -xvf qemu-8.1.2.tar.xz
      cd qemu-8.1.2
      mkdir res
      cd res
      sudo apt install libspice-protocol-dev libepoxy-dev libgtk-3-dev libspice-server-dev build-essential autoconf automake autotools-dev pkg-config bc curl gawk git bison flex texinfo gperf libtool patchutils mingw-w64 libmpc-dev libmpfr-dev libgmp-dev libexpat-dev libfdt-dev zlib1g-dev libglib2.0-dev libpixman-1-dev libncurses5-dev libncursesw5-dev meson libvirglrenderer-dev libsdl2-dev -y
      ../configure --target-list=riscv64-softmmu,riscv64-linux-user --prefix=/usr/local/bin/qemu-riscv64 --enable-slirp
      make -j$(nproc)
      sudo make install
      

      The above commands will install QEMU to /usr/local/bin/qemu-riscv64. Add /usr/local/bin/qemu-riscv64/bin to $PATH.

      For compilation and installation on other OSs, including openEuler, see the QEMU official documentation.

      You can refer to the compilation procedure on RHEL or CentOS for the compilation on openEuler, for example:

      sudo dnf install -y git glib2-devel libfdt-devel pixman-devel zlib-devel bzip2 ninja-build python3 \
                      libaio-devel libcap-ng-devel libiscsi-devel capstone-devel \
                      gtk3-devel vte291-devel ncurses-devel \
                      libseccomp-devel nettle-devel libattr-devel libjpeg-devel \
                      brlapi-devel libgcrypt-devel lzo-devel snappy-devel \
                      librdmacm-devel libibverbs-devel cyrus-sasl-devel libpng-devel \
                      libuuid-devel pulseaudio-libs-devel curl-devel libssh-devel \
                      systemtap-sdt-devel libusbx-devel
      curl -LO https://download.qemu.org/qemu-8.1.2.tar.xz
      tar -xvf qemu-8.1.2.tar.xz
      cd qemu-8.1.2
      mkdir res
      cd res
      ../configure --target-list=riscv64-softmmu,riscv64-linux-user --prefix=/usr/local/bin/qemu-riscv64
      make -j$(nproc)
      sudo make install
      

      Preparing the openEuler RISC-V Disk Image

      Disk Image Download

      Download the boot firmware (fw_payload_oe_uboot_2304.bin), disk image (openEuler-23.09-RISC-V-qemu-riscv64.qcow2.xz) and startup script (start_vm.sh).

      Download Directory

      The current build is located in the openEuler Repo. You can also visit the openEuler official website to obtain the image from other mirrored sources.

      Content Description

      • fw_payload_oe_uboot_2304.bin: Boot firmware
      • openEuler-23.09-RISC-V-qemu-riscv64.qcow2.xz: Compressed disk image for the openEuler RISC-V QEMU virtual machine (VM)
      • openEuler-23.09-RISC-V-qemu-riscv64.qcow2.xz.sha256sum: Verification file for the compressed disk image. Run sha256sum -c openEuler-23.09-RISC-V-qemu-riscv64.qcow2.xz.sha256sum for verification.
      • start_vm.sh: Official VM startup script

      (Optional) Copy-On-Write (COW) Disk Configuration

      The copy-on-write (COW) technology does not make changes to the original image file; the modification is written to another image file. This feature is only supported by the QCOW format in QEMU. Multiple disk images can point to the same image for testing multiple configurations without damaging the original image.

      Creating an Image

      Run the following command to create an image, and use the new image when starting the virtual machine below. Assume that the original image is openEuler-23.09-RISC-V-qemu-riscv64.qcow2, and the new image is test.qcow2.

      qemu-img create -o backing_file=openEuler-23.09-RISC-V-qemu-riscv64.qcow2,backing_fmt=qcow2 -f qcow2 test.qcow2
      

      Viewing Image Information

      qemu-img info --backing-chain test.qcow2
      

      Modifying the Base Image Location

      Run the following command to modify the base image location. Assume that the new base image is another.qcow2, and the image to be modified is test.qcow2.

      qemu-img rebase -b another.qcow2 test.qcow2
      

      Merging Images

      Merge the modified image into the original image. Assume that the new image is test.qcow2.

      qemu-img commit test.qcow2
      

      Expanding Root Partition

      To expand the root partition for more available space, perform the operations below.

      Expand the disk image.

      qemu-img resize test.qcow2 +100G
      

      Output

      Image resized.
      

      Start the VM and run the following command to check the disk size.

      lsblk
      

      List the partition information.

      fdisk -l
      

      Modify the root Partition.

      fdisk /dev/vda
      Welcome to fdisk (util-linux 2.35.2).
      Changes will remain in memory only, until you decide to write them.
      Be careful before using the write command.
      
      Command (m for help): p # Display partition information.
      Disk /dev/vda: 70 GiB, 75161927680 bytes, 146800640 sectors
      Units: sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 512 bytes
      I/O size (minimum/optimal): 512 bytes / 512 bytes
      Disklabel type: dos
      Disk identifier: 0x247032e6
      
      Device     Boot   Start      End  Sectors Size Id Type
      /dev/vda1          2048  4194303  4192256   2G  e W95 FAT16 (LBA)
      /dev/vda2       4194304 83886079 79691776  38G 83 Linux
      
      Command (m for help): d # Delete the existing partition.
      Partition number (1,2, default 2): 2
      
      Partition 2 has been deleted.
      
      Command (m for help): n # Create new partition.
      Partition type
         p   primary (1 primary, 0 extended, 3 free)
         e   extended (container for logical partitions)
      Select (default p): p # Select the primary partition.
      Partition number (2-4, default 2): 2
      First sector (4194304-146800639, default 4194304): # The starting block here should be consistent with the /dev/vda2 mentioned above.
      Last sector, +/-sectors or +/-size{K,M,G,T,P} (4194304-146800639, default 146800639): # Keep the default and allocate directly to the end.
      
      Created a new partition 2 of type 'Linux' and of size 68 GiB.
      Partition #2 contains a ext4 signature.Do you want to remove the signature? [Y]es/[N]o: n
      
      Command (m for help): p # Check again.
      
      Disk /dev/vda: 70 GiB, 75161927680 bytes, 146800640 sectors
      Units: sectors of 1 * 512 = 512 bytes
      Sector size (logical/physical): 512 bytes / 512 bytes
      I/O size (minimum/optimal): 512 bytes / 512 bytes
      Disklabel type: dos
      Disk identifier: 0x247032e6
      
      Device     Boot   Start       End   Sectors Size Id Type
      /dev/vda1          2048   4194303   4192256   2G  e W95 FAT16 (LBA)
      /dev/vda2       4194304 146800639 142606336  68G 83 Linux
      
      Command (m for help): w # Write to the disk.
      The partition table has been altered.
      Syncing disks.
      

      Update Disk Information.

      resize2fs /dev/vda2
      

      Launching the openEuler RISC-V VM

      Starting the VM

      • Ensure that the current directory contains fw_payload_oe_uboot_2304.bin, the disk image compressed file, and the startup script.
      • Decompress the image file with xz -dk openEuler-23.09-RISC-V-qemu-riscv64.qcow2.xz.
      • Adjust the startup parameters.
      • Run the startup script using $ bash start_vm.sh.

      (Optional) Adjusting Startup Parameters

      • vcpu specifies the number of QEMU threads, which does not strictly correspond to the number of CPU cores. If the vcpu value exceeds the number of CPU cores of the host machine, the execution may be slowed or blocked. The default value is 4.
      • memory specifies the size of the VM memory and can be adjusted as needed. The default value is 2.
      • drive specifies the path of the virtual disk. If you configure the COW image as mentioned earlier, enter the path of the created image.
      • fw specifies the path for the U-Boot image.
      • ssh_port specifies the port forwarded for SSH, defaulting to 12055. Set it to blank to disable this feature.

      Logging into the VM

      The script offers support for SSH logins.

      If the VM is exposed to a public network, change the root user password immediately after logging in.

      SSH Login

      Secure Shell (SSH) is an encrypted network transfer protocol, offering a secure transfer environment for network services over an unsecured network. SSH achieves this by creating a secure tunnel to connect SSH clients and servers. The most common use for SSH is for remote OS login, including the remote CLI and remote command execution. While SSH is most frequently used on Unix-like OSs, some of its functions are also available on Windows. In 2015, Microsoft announced they would provide native SSH protocol support in future Windows OSs. The OpenSSH client is available in Windows 10 1803 and later versions.

      • Username: root or openeuler
      • Default Password: openEuler12#$
      • Login method: See script prompts (or use your preferred SSH client).

      Upon successful login, you will see the following information:

      Authorized users only. All activities may be monitored and reported.
      
      Authorized users only. All activities may be monitored and reported.
      Last login: Sun Oct 15 17:19:52 2023 from 10.0.2.2
      
      Welcome to 6.4.0-10.1.0.20.oe2309.riscv64
      
      System information as of time:  Sun Oct 15 19:40:07 CST 2023
      
      System load:    0.47
      Processes:      161
      Memory used:    .7%
      Swap used:      0.0%
      Usage On:       11%
      IP address:     10.0.2.15
      Users online:   1
      
      [root@openeuler ~]#
      

      VNC Login

      This method is natively supported by QEMU and is similar to remotely operating a physical machine without sound.

      Virtual Network Computing (VNC) is a screen sharing and remote operation program that uses the Remote Frame Buffer (RFB) protocol. VNC sends keyboard and mouse actions as well as real-time screen images through the network.

      VNC is independent of the OS, which means it can be used across platforms. For instance, a Windows computer can connect to a Linux computer, and vice versa. You can even use VNC through a Java-supported browser on a computer without the client software.

      Installing VNC Viewer

      Download TigerVNC or VNC Viewer.

      Modifying the Startup Script

      Before the sleep 2 line in the startup script, add the following content:

      vnc_port=12056
      echo -e "\033[37mVNC Port:        \033[0m \033[34m"$vnc_port"\033[0m"
      cmd="${cmd} -vnc :"$((vnc_port-5900))
      

      Connecting to VNC

      Launch TigerVNC or VNC Viewer, paste the address, and press Enter. The operating interface is similar to that of a physical machine.

      Modifying the Default Software Source Configuration

      The software source for openEuler 23.09 RISC-V version currently only contains the [OS] and [source] repositories. However, the default configuration file includes other repositories not provided in this RISC-V version.

      Before using a package manager to install software packages, edit the software source configuration to keep only the [OS] and [source] sections.

      Connect to the VM via SSH or VNC and log in as the root user (if you log in as a non-privileged user, run the commands with sudo). Then, perform the following operations.

      Modify /etc/yum.repos.d/openEuler.repo

      vi /etc/yum.repos.d/openEuler.repo
      # or: nano /etc/yum.repos.d/openEuler.repo
      

      Remove the [everything], [EPOL], [debuginfo], [update], and [update-source] sections to keep only the [OS] and [source] sections.

      After making the changes, the configurations in openEuler.repo should be similar to the following:

      #generic-repos is licensed under the Mulan PSL v2.
      #You can use this software according to the terms and conditions of the Mulan PSL v2.
      #You may obtain a copy of Mulan PSL v2 at:
      #    http://license.coscl.org.cn/MulanPSL2
      #THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
      #IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
      #PURPOSE.
      #See the Mulan PSL v2 for more details.
      
      [OS]
      name=OS
      baseurl=http://repo.openeuler.org/openEuler-23.09/OS/$basearch/
      metalink=https://mirrors.openeuler.org/metalink?repo=$releasever/OS&arch=$basearch
      metadata_expire=1h
      enabled=1
      gpgcheck=1
      gpgkey=http://repo.openeuler.org/openEuler-23.09/OS/$basearch/RPM-GPG-KEY-openEuler
      
      [source]
      name=source
      baseurl=http://repo.openeuler.org/openEuler-23.09/source/
      metalink=https://mirrors.openeuler.org/metalink?repo=$releasever&arch=source
      metadata_expire=1h
      enabled=1
      gpgcheck=1
      gpgkey=http://repo.openeuler.org/openEuler-23.09/source/RPM-GPG-KEY-openEuler
      

      Then, you can use the DNF package manager to install software packages normally. When installing for the first time, it is necessary to import the openEuler GPG key. If you see the following prompt, enter y to confirm.

      retrieving repo key for OS unencrypted from http://repo.openeuler.org/openEuler-23.09/OS/riscv64/RPM-GPG-KEY-openEuler
      OS                                               18 kB/s | 2.1 kB     00:00
      Importing GPG key 0xB25E7F66:
       Userid     : "private OBS (key without passphrase) <defaultkey@localobs>"
       Fingerprint: 12EA 74AC 9DF4 8D46 C69C A0BE D557 065E B25E 7F66
       From       : http://repo.openeuler.org/openEuler-23.09/OS/riscv64/RPM-GPG-KEY-openEuler
      Is this ok [y/N]: y
      Key imported successfully
      

      Bug Catching

      Buggy Content

      Bug Description

      Submit As Issue

      It's a little complicated....

      I'd like to ask someone.

      PR

      Just a small problem.

      I can fix it online!

      Bug Type
      Specifications and Common Mistakes

      ● Misspellings or punctuation mistakes;

      ● Incorrect links, empty cells, or wrong formats;

      ● Chinese characters in English context;

      ● Minor inconsistencies between the UI and descriptions;

      ● Low writing fluency that does not affect understanding;

      ● Incorrect version numbers, including software package names and version numbers on the UI.

      Usability

      ● Incorrect or missing key steps;

      ● Missing prerequisites or precautions;

      ● Ambiguous figures, tables, or texts;

      ● Unclear logic, such as missing classifications, items, and steps.

      Correctness

      ● Technical principles, function descriptions, or specifications inconsistent with those of the software;

      ● Incorrect schematic or architecture diagrams;

      ● Incorrect commands or command parameters;

      ● Incorrect code;

      ● Commands inconsistent with the functions;

      ● Wrong screenshots.

      Risk Warnings

      ● Lack of risk warnings for operations that may damage the system or important data.

      Content Compliance

      ● Contents that may violate applicable laws and regulations or geo-cultural context-sensitive words and expressions;

      ● Copyright infringement.

      How satisfied are you with this document

      Not satisfied at all
      Very satisfied
      Submit
      Click to create an issue. An issue template will be automatically generated based on your feedback.
      Bug Catching
      编组 3备份