[英]Is it possible to run VM with ppc64le architecture on a host machine with x86_64 architecture?
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. 我想测试一些需要在“ ppc64le”架构上运行的用例,但我没有具有ppc64le架构的主机。
My host system is of x86_64 architecture. 我的主机系统是x86_64体系结构。 Is it possible to run VM with 'ppc64le' architecture on my host machine with x86_64 architecture?
是否可以在具有x86_64架构的主机上运行具有'ppc64le'架构的VM?
Absolutely! 绝对! The only caveat is that since you're not running natively, the virtual machine needs to emulate the target (ppc64le) instruction set.
唯一需要注意的是,由于您不是在本地运行,因此虚拟机需要模拟目标(ppc64le)指令集。 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. 例如,
virt-manager
允许您在创建新的虚拟机时选择体系结构类型。 If you set this to ppc64el, you'll get a ppc64el machine. 如果将其设置为ppc64el,则将获得ppc64el机器。 Other options (like disk and network devices) can be set just like native VMs.
可以像设置本地VM一样设置其他选项(例如磁盘和网络设备)。
If you're not using any specific VM management tools, the following invocation of qemu will get a ppc64el machine going easily: 如果您未使用任何特定的VM管理工具,则以下qemu调用将使ppc64el计算机轻松运行:
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. -nographic -serial pty
使用文本控制台而不是模拟图形设备。 qemu will print the console pty on startup - something like /dev/pts/X
. qemu将在启动时打印控制台pty-类似于
/dev/pts/X
Run screen /dev/pts/X
to access it. 运行
screen /dev/pts/X
进行访问。
-M powernv -bios skiboot.lid
to use the non-virtualised ppc64el machine model, which is closer to current OpenPOWER hardware. -M powernv -bios skiboot.lid
以使用非虚拟化的ppc64el机器模型,该模型更接近当前的OpenPOWER硬件。 The skiboot.lid
firmware may be included in your distro's install of qemu. skiboot.lid
固件可能包含在发行版的qemu安装中。
-drive
, -device
and -netdev
to configure virtual disks and networking. -drive
, -device
和-netdev
来配置虚拟磁盘和网络。 These work in the same manner at x86 VMs on qemu. 这些在qemu上的x86 VM上以相同的方式工作。
I hosted centos7-ppc64le on my x86_64 machine(OS RHEL-7). 我在x86_64机器(OS RHEL-7)上托管了centos7-ppc64le。 I used qemu + virt-install for that.
我为此使用了qemu + virt-install。 First install qemu as
首先安装qemu作为
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. 安装后,可从命令行查看qemu-system-ppc64le。 Then install virt-manager,virt-install,virt-viewer and libvirt for managing the VM's.
然后安装virt-manager,virt-install,virt-viewer和libvirt来管理VM。 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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.