diff options
-rwxr-xr-x | kvmx | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -373,14 +373,14 @@ function kvmx_up { fi if [ -z "$net" ] || [ "$net" == "user" ]; then - net_opts="user,hostfwd=tcp:127.0.0.1:$SSH-:22,hostfwd=udp:127.0.0.1:$XDMCP_PORT-:177$hostfwd" + net_opts="user,hostfwd=tcp:127.0.0.1:$SSH-:22,hostfwd=udp:127.0.0.1:$XDMCP_PORT-:177$hostfwd -net nic,model=$nic_model" elif [ "$net" == "tap" ]; then # Thanks kvm-manager tap="${VM}0" # MAC address is derived from a hash of the host's name and the guest's name: mac_address="$(printf "02:%s" "$(printf "%s\0%s" "$(hostname)" "${VM}" | sha256sum | sed 's/\(..\)/\1:/g' | cut -f1-5 -d:)")" bridge="br0" - net_opts="tap,ifname=$tap,script=no,downscript=no,vlan=0,name=hostnet0" + net_opts="tap,ifname=$tap,script=no,downscript=no,vlan=0,name=hostnet0 -device virtio-net-pci,vlan=0,id=net0,mac=$mac_address,bus=pci.0" fi # Run virtual machine @@ -394,7 +394,6 @@ function kvmx_up { -chardev "socket,id=monitor,path=$MONITORFILE,server,nowait" -mon chardev=monitor,mode=readline \ -chardev "socket,id=serial0,path=$CONSOLEFILE,server" -device isa-serial,chardev=serial0 \ -smp $smp -soundhw ac97 -cpu host -balloon virtio \ - -net nic,model=$nic_model \ -net $net_opts \ $qemu_opts &> $LOGFILE < /dev/null & |