Is it possible to run VM with ppc64le architecture on a host machine with x86_64 architecture?
Asked Answered
M

2

5

I want to test some use-cases which need to run on 'ppc64le' architecture but I don't have a host machine with ppc64le architecture.

My host system is of x86_64 architecture. Is it possible to run VM with 'ppc64le' architecture on my host machine with x86_64 architecture?

Ministration answered 12/11, 2018 at 10:9 Comment(2)
yes it is. You just need to install the correct qemu-variant for that architecture. On archlinux it is qemu-ppc64le contained in the qemu-arch-extra package. I guess other distros have similar packagesFaydra
Thanks a lot qemu-system-ppc64le works for me.Ministration
U
6

Absolutely! The only caveat is that since you're not running natively, the virtual machine needs to emulate the target (ppc64le) instruction set. This can be much slower than running native instructions.

The way to do this will depend on which tools you're using to manage your virtual machine instances. For example, virt-manager allows you to select the architecture type when you're creating a new virtual machine. If you set this to ppc64el, you'll get a ppc64el machine. Other options (like disk and network devices) can be set just like native VMs.

If you're not using any specific VM management tools, the following invocation of qemu will get a ppc64el machine going easily:

qemu-system-ppc64le \
    -M pseries                            # use the pseries machine model \
    -m 4G                                 # with 4G of RAM \
    -hda ubuntu-18.04-server-ppc64el.iso  # Ubuntu installer as a virtual disk

Depending on your usage, you may want to use the following options too:

  • -nographic -serial pty to use a text console instead of an emulated graphics device. qemu will print the console pty on startup - something like /dev/pts/X. Run screen /dev/pts/X to access it.

  • -M powernv -bios skiboot.lid to use the non-virtualised ppc64el machine model, which is closer to current OpenPOWER hardware. The skiboot.lid firmware may be included in your distro's install of qemu.

  • -drive, -device and -netdev to configure virtual disks and networking. These work in the same manner at x86 VMs on qemu.

Unmanned answered 13/11, 2018 at 8:28 Comment(3)
Thanks a lot qemu-system-ppc64le works for me. But with virt-manager I don't find any option to change the architecture. It only shows Hypervisor:KVM and Architecture:x86_64. Do you have any idea about it??Ministration
How can I check whether qemu supports ppc64le architecture?? Because in one of my RHEL machine there is no option like qemu-system-*. It has only options like qemu-img, qemu-io, qemu-nbd, qemu-pr-helper.Ministration
qemu supports ppc64el, but it needs to be built for that architecture - a single qemu binary only supports one arch - that's why Ubuntu has separate qemu-system-<arch> binaries. It's up to your distro on whether or not they provide those builds - I'm not familiar with how RHEL packages qemu though. As for virt-manager, does your hypervisor allow other arches? Check with virsh capabilities.Unmanned
M
1

I hosted centos7-ppc64le on my x86_64 machine(OS RHEL-7). I used qemu + virt-install for that. First install qemu as

wget https://download.qemu.org/qemu-3.1.0-rc1.tar.xz
tar xvJf qemu-3.1.0-rc1.tar.xz
cd qemu-3.1.0-rc1
./configure        
make
make install

After installation check qemu-system-ppc64le is available from the command line. Then install virt-manager,virt-install,virt-viewer and libvirt for managing the VM's. Then I started the VM as

virt-install --name centos7-ppc64le \  
--disk centos7-ppc64le.qcow2  \
--machine pseries  \
--arch ppc64  \
--vcpus 2  \
--cdrom CentOS-7-ppc64le-Minimal-1804.iso \ 
--memory 2048 \
--network=bridge:virbr0 \ 
--graphics vnc 
Ministration answered 19/11, 2018 at 14:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.