Quantcast
Channel: Ubuntu Forums - Virtualisation
Viewing all articles
Browse latest Browse all 4211

KVM: qemu - can't start guest as non-root using "runas ..."

$
0
0
I start my Windows 10 guest using a batch script and the qemu-system-x86_64 command. Whenever I try to run that script using the qemu
Code:

-runas kvm
option, the guest won't start.

I checked various permissions, added my user to the kvm group, tried both kvm and user in the -runas option, but nothing works. I also made sure the /dev/hugepages have the right permissions.

Can someone help me out and point me to the various places where I need to set or modify permissions?

I don't use virsh, libvirt or virt-manager and prefer not to use them.

Thanks!

Here is the complete qemu command:
Code:

qemu-system-x86_64 \
  -name $vmname,process=$vmname \
  -runas=kvm \
  -machine type=q35,accel=kvm \
  -cpu host,kvm=off \
  -smp 4,sockets=1,cores=2,threads=2 \
  -enable-kvm \
  -m 4G \
  -mem-path /run/hugepages/kvm \
  -mem-prealloc \
  -balloon none \
  -rtc clock=host,base=localtime \
  -vga none \
  -nographic \
  -serial none \
  -parallel none \
  -soundhw hda \
  -usb -usbdevice host:045e:076c -usbdevice host:045e:0750 \
  -device vfio-pci,host=02:00.0,multifunction=on \
  -device vfio-pci,host=02:00.1 \
  -drive if=pflash,format=raw,readonly,file=/usr/share/edk2.git/ovmf-x64/OVMF_CODE-pure-efi.fd \
  -drive if=pflash,format=raw,file=/tmp/my_vars.fd \
  -boot order=c \
  -device virtio-scsi-pci,id=scsi \
  -drive id=disk0,if=virtio,cache=none,format=raw,file=/media/user/win.img \
  -netdev type=tap,id=net0,ifname=tap0,vhost=on \
  -device virtio-net-pci,netdev=net0,mac=00:16:3e:00:01:01

Note: No problem running the Windows guest with root permissions.

Viewing all articles
Browse latest Browse all 4211

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>