Lfs User wrote:
To use -net nic -net tap (bridging) with qemu as a user I had to also:

chgrp kvm /sbin/ip /usr/sbin/brctl /usr/bin/qemu-system-x86_64
setcap cap_net_admin=eip /usr/sbin/brctl
setcap cap_net_admin=eip /usr/bin/qemu-system-x86_64
setcap cap_net_admin=eip /sbin/ip

This requires libcap.  I don't use pam.

I could not get bridging working with dhcpcd (in the host), it kept
timing out.  I had to use a static ip address as in the example in the
book.  dhcpcd works fine in the VM.

Is there a requirement to run qemu as a non-root user? The capabilities are really in root's domain.

I think you also could run as a non-root user with appropriate permissions in sudo.

I'm willing to expand the configuration if there is a real need, but this is an example of the scripts I use:


$ cat start-deb2.sh
#!/bin/bash

SUDO=sudo
[ $EUID == 0 ] && SUDO=

$SUDO qemu -enable-kvm -boot c \
           -drive file=/mnt/qemu1/debian2.img,if=virtio \
           -m 2G \
           -net nic -net tap -machine accel=kvm

  -- Bruce

--
http://lists.linuxfromscratch.org/listinfo/blfs-dev
FAQ: http://www.linuxfromscratch.org/blfs/faq.html
Unsubscribe: See the above information page

Reply via email to