From 79dceafaec991c67822ebce8d998bc775f7afb46 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Sat, 30 Dec 2017 19:09:08 -0200 Subject: Updates net_opts --- kvmx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/kvmx b/kvmx index cb0e31b..242a3ff 100755 --- a/kvmx +++ b/kvmx @@ -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 & -- cgit v1.2.3