Can I run qemu inside guest CT ?

kevinyuan

New Member
Apr 1, 2022
1
0
1
Dear support team,

I want to setup a hw/sw co-simulation environment with Centos 8 runing on PVE CT.

The setup steps are documented in:
https://github.com/RSPwFPGAs/virtio-fpga/tree/master/sw/QEMU/qemu_hdl_cosim

However, when I start the qemu-system-x86_64, the system complains an error:

Code:
sudo qemu-2.10.0-rc3/build/x86_64-softmmu/qemu-system-x86_64 -boot d -cdrom /sda/iso/ubuntu-18.04.4-live-server-amd64.iso -smp cpus=2 -accel kvm -m 4096 -hda cosim.qcow2
Could not access KVM kernel module: No such file or directory
qemu-system-x86_64: failed to initialize KVM: No such file or directory

I tried to enable the nesting, but the error still exists.

Is there any limitation that qemu can't be run inside guest CT?

If no, can anyone help to provide a solution to resolve this issue ?
 
Nesting for containers is required to nest other containerised systems like docker. To nest KVM you would need to run a full VM with KVM Hardware Virtualisation enabled in the VM options
 
I would assume that running QEMU/KVM from with a container should work. Make sure that your user/root in the container has enough permissions. You probably need a privileged container and you need to load all required kernel modules on the Proxmox host first (because the container shares the host kernel). Also make sure that the various versions of QEMU on CentOS 8 and the Proxmox kernel (modules) are compatible.
It is probably easier to run QEMU/KVM inside a VM by enabling nested virtualization.