fix #4 (really): use -device and -netdev options instead of -redir

The correct arguments to qemu are

	-netdev user,id=ethernet.0,hostfwd=tcp::5555-:1522,hostfwd=tcp::9999-:9,hostfwd=tcp::17010-:17010,hostfwd=tcp::17013-:17013
		to forward several host ports to the guests ports on ethernet.0
	-device rtl8139,netdev=ethernet.0
		to define the emulated hardware of ethernet.0

They are both required and the netdev's value of the -device option
must match the id's value of the -netdev option.
This commit is contained in:
2017-09-04 22:56:36 +02:00
parent 39de8b3851
commit e286892bf9
3 changed files with 8 additions and 18 deletions

View File

@@ -58,12 +58,8 @@ $kvmdo qemu-system-x86_64 -s -cpu Haswell -smp $NCPU -m 2048 $kvmflag \
-no-reboot -serial mon:stdio \
--machine $machineflag \
$bootDisk \
-net nic,model=rtl8139 \
-net user,hostfwd=tcp::5555-:1522 \
-net dump,file=/tmp/vm0.pcap \
-netdev user,id=tcp9,hostfwd=tcp::9999-:9 \
-netdev user,id=tcp17010,hostfwd=tcp::17010-:17010 \
-netdev user,id=tcp17013,hostfwd=tcp::17013-:17013
-netdev user,id=ethernet.0,hostfwd=tcp::5555-:1522,hostfwd=tcp::9999-:9,hostfwd=tcp::17010-:17010,hostfwd=tcp::17013-:17013 \
-device rtl8139,netdev=ethernet.0
EOF
# To enable qemu log: