0

When I try TAP Interface the qemu, the VM freezes, not sure why. But with -netdev user it doesn't freeze but can't connect to the VM at all.

I tested using ESXi and Centos 7 both VM freezes when using Tap interface. Centos 7 VM starts fine but when restarting eth0 the VM freezes and doesn't recover. ESXi freezes during loading when using Tap interrace.

I used openVPN to create a Tap interface on windows 10, renamed the interface to Ethernet7 and used the following command when running Qemu VM.

-netdev tap,ifname=Ethernet7,script=no,downscript=no,id=hostnet0 -device e1000,netdev=hostnet0,id=net0,mac=DE:AD:BE:EF:16:B6

I downloaded the latest Windows version of Qemu from qemu.org

user630702
  • 495
  • 10
  • 32

1 Answers1

0

Update: TAP interface wasn't working due to Windows 10 Tap interface was using a old 2014 driver. I created a new interface (using hdwwiz.exe) and I had the option to select 2019 driver instead of old driver. TAP interface works fine and doesn't freeze the VM.

User mode networking also works fine if you don't need TAP interface.

qemu-system-x86_64 -boot d -hda centos.img -m 2048 -smp cpus=2,cores=2 -netdev user,id=n1,hostfwd=tcp::2222-:22 -device e1000,netdev=n1

In the Centos I had to run the command dhclient eth0 as it doesn't get dhcp IP assigned automatically. After running the command, the VM gets the IP address of 10.0.2.15 and then I can SSH to it using ssh -p 2222 root@localhost.

For ESXi, I had to enable SSHD in the ESXi settings and use localhost to connect. ICMP doesn't work for both in User mode networking.

qemu-system-x86_64 -boot d -hda esxi.img -m 4096 -cpu Westmere -machine q35 -smp cpus=2,cores=2 -accel tcg -netdev user,id=n1,hostfwd=tcp::2223-:22,hostfwd=tcp::9443-:443,hostfwd=tcp::8085-:80 -device e1000,netdev=n1

user630702
  • 495
  • 10
  • 32