utmapp / UTM

Virtual machines for iOS and macOS
https://getutm.app
Apache License 2.0
25.06k stars 1.27k forks source link

Windows 11 ARM Network Issue #6442

Open PokiFOX opened 1 week ago

PokiFOX commented 1 week ago

Describe the issue
I encountered a rather peculiar issue while using UTM.

My device has two network cards. One is connected to a wired network (en6), but this wired network is an internal network and cannot connect to the Internet. The other is a wireless network card (en1), which connects to a wireless network that has Internet access.

en6: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=6464<VLAN_MTU,TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
    ether 20:7b:d5:1a:1d:d3
    inet6 fe80::1c5c:d3ae:afb2:fb0f%en6 prefixlen 64 secured scopeid 0xb 
    inet 192.168.126.10 netmask 0xffffff00 broadcast 192.168.126.255
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect (100baseTX <full-duplex>)
    status: active
en1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=6460<TSO4,TSO6,CHANNEL_IO,PARTIAL_CSUM,ZEROINVERT_CSUM>
    ether 5c:1b:f4:de:1a:d5
    inet6 fe80::43e:81ab:ae21:b97%en1 prefixlen 64 secured scopeid 0xe 
    inet 192.168.8.5 netmask 0xffffff00 broadcast 192.168.8.255
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active

Then I installed Windows 11 ARM on UTM and used the shared network with a virtio-net-pci emulated network card, which created a new network card, bridge100, on macOS.

bridge100: flags=8a63<UP,BROADCAST,SMART,RUNNING,ALLMULTI,SIMPLEX,MULTICAST> mtu 1500
    options=3<RXCSUM,TXCSUM>
    ether 5e:1b:f4:1e:ca:64
    inet 192.168.64.1 netmask 0xffffff00 broadcast 192.168.64.255
    inet6 fe80::5c1b:f4ff:fe1e:ca64%bridge100 prefixlen 64 optimistic scopeid 0x16 
    inet6 fd1f:409e:2a35:baa7:1c16:6b66:a023:55d prefixlen 64 tentative autoconf secured 
    Configuration:
        id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
        maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
        root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
        ipfilter disabled flags 0x0
    member: vmenet0 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 21 priority 0 path cost 0
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active

In my Windows 11 ARM, the network query results are as follows:

Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : fd1f:409e:2a35:baa7:295e:4cf1:edb0:4e45
   Temporary IPv6 Address. . . . . . : fd1f:409e:2a35:baa7:a9d2:731f:20f2:a02c
   Link-local IPv6 Address . . . . . : fe80::295e:4cf1:edb0:4e45%14
   IPv4 Address. . . . . . . . . . . : 192.168.64.8
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.64.1

Now, if I ping Google from Windows 11 ARM, it works. However, if I ping the address of the en6 network card, it doesn't work. I specifically want to use this internal network port en6.

If I change the network mode to Bridged (Advanced) and bridge the en6 interface, an even stranger phenomenon occurs. In my Windows 11 ARM, the network query results are as follows:

Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::295e:4cf1:edb0:4e45%14
   Autoconfigured IPv4 Address . . . : 169.254.78.69
   Subnet Mask . . . . . . . . . . . : 255.255.0.0
   Default Gateway . . . . . . . . . :

And now, I cannot ping either the internal network or the external network.

Configuration

Crash log
If the app crashed, you need a crash log. To get your crash log, open Console.app, go to Crash Reports, and find the latest entry for either UTM, QEMU, QEMUHelper, or qemu-*. Right click and choose Reveal in Finder. Attach the report here.

Debug log
attached.

PokiFOX commented 1 week ago

debug_bridge.log debug_share.log

PokiFOX commented 1 week ago

If I go to Settings, then Bridged -> Show Advanced Settings, and set the guest network IP, the following error occurs:

QEMU error: QEMU exited with an error: qemu-aarch64-softmmu: -netdev vmnet-bridged,id=net0,ifname=en6,start-address=192.168.126.1,end-address=192.168.126.254,subnet-mask=255.255.255.0: Invalid parameter 'subnet-mask'

berkantkockaya commented 1 week ago

Hello, when I faced the same issue, I resolved it by selecting Internet > Internet Mode (Bridged (advanced)) in the UTM settings. I hope this helps you as well.

If you need any further assistance, feel free to ask!

PokiFOX commented 1 week ago

I tried setting the network mode to Bridged (Advanced) and specifying the interface for the internal network, but when I entered the virtual machine, I found that there were no network devices. If I forcefully specify the IP in the advanced settings, I get an error when starting the virtual machine:

QEMU error: QEMU exited with an error: qemu-aarch64-softmmu: -netdev vmnet-bridged,id=net0,ifname=en6,start-address=192.168.126.1,end-address=192.168.126.254,subnet-mask=255.255.255.0: Invalid parameter 'subnet-mask'

berkantkockaya commented 1 week ago
Ekran Resmi 2024-06-24 11 00 31

Can you verify the settings as shown in the image?

berkantkockaya commented 1 week ago
  1. Using Shared Network Mode: • When using the Shared Network mode, the Windows 11 ARM virtual machine can access the internet through the bridge100 network interface on the macOS host machine. This means the internet connection is working. However, it cannot access the internal network on en6. • Reason: In Shared Network mode, there isn’t a direct bridge between the virtual machine and the host’s en6 interface. Therefore, direct access to en6 is not possible.
    1. Using Bridged Network Mode: • When switching to Bridged Network mode and bridging to the en6 interface, the Windows 11 ARM virtual machine fails to obtain an IPv4 address and defaults to a 169.254.x.x APIPA address (Automatic Private IP Addressing). This indicates the absence of a DHCP server on the network. • Reason: Since there is no DHCP server on the network connected to en6, the virtual machine cannot obtain an IP address, preventing network communication.

Possible Solutions

Solution 1: Assigning a Static IP Address

In Bridged Network mode, you can resolve the issue by assigning a static IP address to the virtual machine.

Steps:

1.  Network Settings on Windows 11 ARM:
•   Go to Network & Internet Settings → Network Adapters → Right-click on Ethernet and select Properties.
•   Select Internet Protocol Version 4 (TCP/IPv4) and click on Properties.
•   Select Use the following IP address and enter a static IP address compatible with the en6 network. For example:
•   IP address: 192.168.126.20
•   Subnet mask: 255.255.255.0
•   Default gateway: (optional, can be left blank)
•   DNS servers: (optional, can be left blank)

Solution 2: Using Different Network Settings for the Virtual Machine

If you need access to both the internet and the internal network, you can follow these steps:

1.  Adding a Second Network Interface:
•   In UTM settings, add a second network interface to the Windows 11 ARM virtual machine. Set the first interface to Shared Network mode and the second interface to Bridged Network mode.
•   Use the first interface for internet access and the second interface for internal network access.

Solution 3: Setting Up a DHCP Server on the Internal Network

If possible, set up a DHCP server on your internal network so the virtual machine can obtain an IP address when using Bridged Network mode.

Steps:

1.  DHCP Server Setup:
•   Set up a DHCP server on a device or server within your internal network to distribute IP addresses via the en6 interface.

Can you check these steps as well?

PokiFOX commented 1 week ago

Thank you very much for your response. If I use the bridge mode, then connecting to the en1 network card can obtain the IP 192.168.8.58 because this network is connected to a dial-up router, which indeed has DHCP enabled.

Following your advice, I added a second network card, also using the bridge mode, connected to the en6 network card. This is a local area network directly connected to a switch via a wired connection. As you analyzed, indeed, there is no DHCP on the switch. Your analysis was very accurate, and I indeed saw the IP was 169.254.X.X. 1811719217718_ pic

I continued following your method, and after shutting down the virtual machine, I set it up in the UTM virtual machine. The settings for en1 and en6 in UTM are as shown in the image below.

1821719217810_ pic 1831719217839_ pic

Now, if I try to directly write the IP address in the settings of en6, I get the prompt shown in the image below when starting the UTM virtual machine.

1841719217852_ pic

PokiFOX commented 1 week ago

I removed the IP address from en6, started the UTM virtual machine, and then set the IP address for en6 within the UTM virtual machine. However, as shown in the image below, I could not save the configuration. 1851719218038_ pic

berkantkockaya commented 1 week ago

Detailed Steps:

  1. Edit IP Settings:

    • Navigate to the network settings in Windows.
    • Ensure manual configuration is selected.
    • Enter the following details:
      • IP Address: 192.168.126.20
      • Subnet Mask: 255.255.255.0
      • Gateway: 192.168.126.1
      • Preferred DNS: 8.8.8.8
  2. Verify Network Adapter in UTM:

    • Open UTM and select your virtual machine.
    • Go to the network settings.
    • Ensure the network adapter is set to bridged mode and attached to en6.
    • Check the MAC address and ensure it does not conflict with other devices.
  3. Apply and Test:

    • Save the configuration changes in both UTM and Windows.
    • Restart the UTM virtual machine.
    • Test connectivity by pinging 192.168.126.1 and other local network devices.
PokiFOX commented 1 week ago

I added a DNS, following your suggestion, 8.8.8.8. The problem was resolved. Thank you so much!