Enterprise Linux

 View Only



LinkedIn Share on LinkedIn

Run a full-system Linux on Power environment from Microsoft Windows

By Linda Alkire posted Thu March 06, 2025 07:23 AM

  

Originally posted on IBM Developer by Paul Clarke and Emma Erickson

Interested in trying out IBM Power architecture without acquiring a full IBM Power system? Want to start taking advantage of features such as reliability, scalability, and performance of the Power architecture?

Consider an emulated Power system! Start the porting and testing processes now with an emulated Power system that runs conveniently on any currently available development system. Practice system installation, configuration, port your development environment, load source code, compile, run, trace, analyze, and tune. Get a head start on using Power architecture and learn while doing it by following this tutorial, which explains how to create a virtual development environment for an emulated Power system running Ubuntu or openSUSE Linux.

Prerequisites

You will need a system with a web browser and public internet access. You will need administrator privileges on your system. A basic understanding of Linux is helpful, but not required.

Estimated time

It takes around 2 to 3 hours to set up and load a Linux distribution on an emulated Power system. It takes 5-10 minutes to reload a Linux distribution once the emulator has been established.

Steps

To establish your emulated Power system, there are 6 major steps. First, you must download QEMU, a free emulator on which you can run your emulated Power system. You also need to create a virtual hard disk using QEMU on which your emulated system will be stored. Next, you must download the ppc64le server installation image file for either Ubuntu or openSUSE. After you have located the downloaded image file on your computer, you can use QEMU and the image file to create your emulated Power system. This section describes these steps in detail.

  • Install Windows Subsystem for Linux (Windows users only).
  • Download QEMU.
  • Create a virtual hard drive for the installation.
  • Download ISO installation image for an IBM Power server.
  • Locate the path to the ISO file.
  • Install Linux Server for IBM Power operating system on virtual hard disk.

 

Install Windows Subsystem for Linux (Windows users only)

If you are on a Windows system, you need to install Windows Subsystem for Linux (WSL) if you have not installed it earlier. WSL automatically runs Ubuntu when it is installed. Refer to the following documentation on how to install WSL: Install Linux on Windows with WSL

 

Download QEMU

Note: Additional ways to install QEMU are located in the "Further investigations" section.

After opening the Linux command prompt, you can download QEMU by performing the following steps:

  1. Download all necessary packages using the following commands:

    • For Debian/Ubuntu distributions and Ubuntu WSL users:
      sudo apt-get -y install git libglib2.0-dev libfdt-dev libpixman-1-dev zlib1g-dev ninja-build make gcc libcap-ng-dev libattr1-dev

    • For openSUSE/SUSE distributions:
      sudo zypper install -y git-core gcc-c++ make qemu glib2-devel libpixman-1-0-devel ninja libcap-ng-devel libattr-devel

    • For Red Hat/Fedora distributions:
      sudo yum -y install git glib2-devel libfdt-devel pixman-devel ninja-build make gcc libcap-ng-devel libattr-devel

  2. Get the QEMU source code from Git.

    Use the following command to get the QEMU source code from Git:

      git clone git://git.qemu-project.org/qemu.git
    
  3. Configure QEMU.

    Navigate to the qemu directory using the following command:

    cd qemu
    

    Then, configure QEMU with the following command:

    ./configure --target-list=ppc64-softmmu --enable-virtfs
    
  4. Make QEMU using the following command:

    make -j
    

The -j flag allows the files to be built simultaneously instead of one at a time, making this step faster. It will take 5 to 10 minutes to make all the files.

 

Create a virtual hard drive for the installation

Different distributions require different amounts of memory for the virtual hard drive. The Ubuntu hard drive minimally requires about 1.GB GB while the openSUSE hard drive minimally requires about 3.5 GB. However, I ran into storage issues when using smaller virtual hard drives, and therefore to be on the safer side, I created a 20 GB virtual hard drive image using the following command:

./build/qemu-img create -f qcow2 ./disk.qcow2 20G

Note: Choose unique file names if creating multiple Linux environments (in the above command, replace disk.qcow2 with the unique file name).

 

Download ISO installation image for an IBM Power server

Pick one of the following Linux distributions, then follow the instructions for that distribution.

  • Download Ubuntu server installation ISO image for IBM Power.

    On the Ubuntu website, scroll down and click the green download button to download the PowerPC server installation ISO image.

    Figure 1

  • Download openSUSE server installation ISO image for IBM Power.

    On the openSUSE website, click the Download tab and scroll down until you see the PowerPC servers, not big-endian (ppc64le) section, and click Download next to Offline Image.

    Figure 2

 

Locate the path to the ISO file

For Windows systems:

  1. Open the File Explorer and navigate to the Downloads folder.

  2. Right-click the disc image file that you downloaded and click Properties.

  3. Click the Details tab and check the folder path.

  4. Make a note of the folder path in a safe temporary location, such as a sticky note. Delete the colon (:) after the C and replace all back slashes () with forward slashes (/). Also note down the file name. Combine them all together to get the complete path to the file in WSL in the following format:

    /mnt/FOLDER_PATH/NAME

    For example, my path for installing Ubuntu ended up looking like this:

    /mnt/c/Users/emma/Downloads/ubuntu-22.04-live-server-ppc64el.iso

For Linux systems:

  1. Navigate to your Downloads folder, which should be accessible by the cd command in the /home/USERNAME/Downloads/ directory.

  2. Confirm that the file you downloaded is available there using the ls command and save the complete path of the downloaded file into a separate, temporary space. It should look something like this:

    /home/USERNAME/Downloads/ubuntu-22.04-live-server-ppc64el.iso

Note: Issues with locating the file path? See the "Troubleshooting tips" section for another method to find your .iso file.

 

Install Linux Server for IBM Power operating system on virtual hard disk

  1. Return to the Linux command prompt.

    Return to the qemu directory using the following command:

    cd ~/qemu

  2. Use the Linux installation ISO file to build an emulated virtual environment. 

    Run the following command, after replacing the text after -cdrom with the location of the downloaded file from the "Locate the path to the ISO file" section.
    ./build/qemu-system-ppc64 -boot order=d -drive file=./disk.qcow2,format=qcow2 -m 4096 -cpu power10 --nographic -cdrom <LocationOfDownloadedIsoFile>
    • The -drive flag specifies the hard drive file, which is the hard drive disk you created earlier.
    • The -m flag specifies the virtual system’s memory, which you may adjust as necessary.
    • The -cpu flag specifies that this system will be run on a virtual IBM Power10 processor. You may be able to run on a virtual IBM Power8 or Power9 processor instead, although that has not been tested.
    • --nographic prevents the system from opening a graphical window, and -cdrom points to the location of the installation medium, in this case, the downloaded ISO file
  3. Follow the installation notes.

    At this point, you should follow the directions on the installation screen to install the Linux distribution you chose. This section provides information about specific notes for different distributions as well as notes that apply to all distributions.

    Notes for all distributions

    • Sometimes, you may need to press Enter to continue the installation process, but that need may not be obvious. If the installation appears to have stalled for a long time, try pressing Enter before panicking.

    • Installation can take over an hour. You will not need to interact with the installation process during this time.

    • The installer might likely fail to unmount /cdrom. This is because cdrom is technically just a file, not a disk. Just press Enter as there is no installation medium to remove.

    • After the installation process is complete, it will take a few minutes to proceed sufficiently through the rebooting process until a login prompt is displayed. Messages may continue to appear on the console even after the login prompt appears. If you are uncertain about if you can log in or are looking for the login prompt, try pressing Enter to get a new login prompt.

    Notes for Ubuntu


    Notes for openSUSE

    • Use a full screen window or do not change the window size during setup.
    • Navigate through the options using the Tab key. Move through internal options using the Up Arrow and Down Arrow keys. Use Enter to select (or deselect, in some cases) options once highlighted with Tab or the arrow keys. Pressing F10 does the same functionality as highlighting Next and pressing Enter.
    • Get the online repositories when prompted to and approve the default/preselected repositories on the next page.
    • When asked about the system role, pick the Server option.
    • As the system performs installation, it tends to stop after the installer completes the analysis. Select Next to install openSUSE.

Future login tasks

After Linux on Power has been installed, it can be run from WSL or the command line (Linux distributions) using the following commands:

cd ~/qemu
./build/qemu-system-ppc64 -boot order=d -drive file=./disk.qcow2,format=qcow2 -m 4096 -cpu power10 --nographic

Wait out the timer on the GNU GRUB screen or press Enter to start Ubuntu/openSUSE. The screen capture of GNU GRUB will appear as shown below.

Ubuntu:

Figure 4

openSUSE:

Figure 5

It only takes a couple minutes to reach the login prompt. Log in with the same username and password as in used in the previous login attempts. If the terminal stops for longer than a minute or two, try pressing Enter to display a new command prompt and/or the login prompt.

 

Troubleshooting tips

This section provides troubleshooting tips for the following issues:

  • The git clone command fails

    Try using:

     git clone https://git.qemu-project.org/qemu.git
    

    Instead of:

     git clone git://git.qemu-project.org/qemu.git
    
  • Nothing is happening during the installation

    If nothing is happening when something should be happening, it seems that pressing Enter one or more times might help, particularly if you were just asked to press Enter. It is possible that the key press didn’t register. Otherwise, just waiting a little bit should work – installation isn’t a quick process, and sometimes it takes a few minutes for different steps to complete.

  • Issues with finding the download path of the ISO file

    On all systems, the download path can be found using the Linux command prompt with the following command:

      find / -wholename "*ppc64??.iso" 2>&1 | grep -v "Permission denied"
    
  • This command finds the full path of all the files ending with ppc64el.iso or ppc64le.iso, starting from the root directory. Most likely, the only ISO files that you have will be in your Downloads folder, but you should double-check that the name of the downloaded file that this finds matches that of your downloaded file. Also, make sure you downloaded the ppc64el (or ppc64le) ISO file from the source website.

    Make sure you temporarily save the full file path somewhere safe, after deleting the dot (.) at the beginning of the file location.

  • QEMU system warnings

    Figure 6

    The terminal will give you the above warnings, but the features shown as unsupported are not required. Therefore, the warnings can be ignored. To eliminate the warning messages, you can append the following code to the build command:

     -M cap-cfpc=broken,cap-sbbc=broken,cap-ibs=broken,cap-ccf-assist=on
    

 

  • Cloud-init errors

    Figure 7

    This failure seems to occur when you have a disk with insufficient storage. Another major source of failure is trying to build two virtual systems simultaneously, which is not recommended.

  • openSUSE installation concerns

    Display of random characters on the screen during the installation process can occasionally happen. While most installations are usually performed in a GUI, we are using a command-line here, and therefore, feel free to ignore them.

    Random characters may have garbled the display, obscuring some options. Navigating through the options will force them to be re-displayed.

 

Further investigations

Should you be interested in alternate approaches or additional setup thoughts, look below!

  • Stable QEMU releases

    If you would like to use a stable QEMU release rather than GitHub, go to https://www.qemu.org/download/ to find the most recent release, then use the following command, replacing the “7.0.0” with the most recent release.

    wget https://download.qemu.org/qemu-7.0.0.tar.xz
    

As with the latest QEMU releases, you must remain in the qemu directory. However, this directory is called qemu-7.0.0, not qemu. Any line that says:
cd ~/qemu

must be replaced with:
cd ~/qemu-7.0.0

  • Package-based QEMU

    Most Linux distributions have QEMU packages and therefore you need not necessarily download and build QEMU from source. If you need to run Linux on Power using QEMU packages, install the following packages into your distribution:

    Ubuntu: qemu qemu-utils qemu-system-ppc
    openSUSE: qemu qemu-tools qemu-ppc

    The major change that this makes is that you do not need to indicate the /qemu path. For example,

    ./build/qemu-system-ppc64 -boot order=d -drive file=./disk.qcow2,format=qcow2 -m 4096 -cpu power10 --nographic -cdrom /mnt/c/Users/emma/Downloads/ubuntu-22.04-live-server-ppc64el.iso

    becomes:

    qemu-system-ppc64 -boot order=d -drive file=./disk.qcow2,format=qcow2 -m 4096 -cpu power9 --nographic -cdrom /mnt/c/Users/emma/Downloads/ubuntu-22.04-live-server-ppc64el.iso

    Also, there is no qemu directory to enter, and therefore, you can ignore any commands containing:

    cd ~/qemu

    Note: Package-based QEMU may not provide support for emulating the latest IBM Power processors, like IBM Power10. In such cases, you can use earlier processor models, like IBM Power9.

Summary

In this tutorial, you learned how to run Linux on Power by using QEMU, download packages in most Linux distributions, create QEMU hard drive disk images, clone a repository from GitHub, and troubleshoot some common errors you may encounter. Congratulations, you should now be able to run a full-system Linux on Power environment from WSL!

Take the next step

Join the Power Developer eXchange Community (PDeX). PDeX is a place for anyone interested in developing open source apps on IBM Power. Whether you're new to Power or a seasoned expert, we invite you to join and begin exchanging ideas, sharing experiences, and collaborating with other members today!

1 comment
16 views

Permalink

Comments

Sat March 08, 2025 10:47 AM

An alternative setup is to install MSYS2 and with it QEMU. For network access to the ppc64le VMs you can install OpenVPN and the TAP driver included. 
(This also works fine for AIX VMs.)