Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows VM: New Network Profiles Generated on Reboot #532

Open
apostrophize opened this issue May 25, 2024 · 5 comments
Open

Windows VM: New Network Profiles Generated on Reboot #532

apostrophize opened this issue May 25, 2024 · 5 comments

Comments

@apostrophize
Copy link

Operating system

Debian 12

Description

I've set up a QEMU virtual machine running Windows. The virtual machine has been successfully installed, and I've manually installed Virtio drivers for networking. However, whenever I initiate a reboot or restart of the virtual machine / Docker container, a new network profile is created (e.g., "Network 2", "Network 3", etc.).

Attempts:
I've tried setting the environment variable "MAC=[generic MAC address]" to ensure consistent network interface identification across reboots, but this hasn't resolved the issue.

Expected Behavior:
Ideally, the network profile should remain consistent across reboots.

Docker compose

  qemu:
    image: qemux/qemu-docker
    container_name: qemu
    cap_add:
      - NET_ADMIN
    environment:
      - BOOT_MODE=windows
      - DISK_SIZE=256G
      - CPU_CORES=4
      - RAM_SIZE=8G
      - ARGUMENTS=-rtc base=localtime
    volumes:
      - ./QEMU:/storage
    ports:
      - 8006:8006
      - 3389:3389
    devices:
      - /dev/kvm
    stop_grace_period: 2m
    restart: on-failure

Docker log

BdsDxe: loading Boot0004 "Windows Boot Manager" from HD(1,GPT,7A2A63BB-FF5D-4F22-9A44-F6722016A7EA,0x800,0x32000)/\EFI\Microsoft\Boot\bootmgfw.efi
BdsDxe: starting Boot0004 "Windows Boot Manager" from HD(1,GPT,7A2A63BB-FF5D-4F22-9A44-F6722016A7EA,0x800,0x32000)/\EFI\Microsoft\Boot\bootmgfw.efi

Screenshots (optional)

image

@kroese
Copy link
Collaborator

kroese commented Jun 12, 2024

@apostrophize Sorry, somehow I did not see your message until now? Is there any reason why you are using this container, and not my other container: dockur/windows because that one is completely designed to run Windows and this one for Linux.

Im curious if you have the same issue with dockur/windows too.

@apostrophize
Copy link
Author

My bad @kroese, GitHub doesn't like email aliases so my account was restricted for a while there.

I did try dockur/windows, and while it works well, the same issue with network profiles being created upon a restart of the container persists. I prefer this container for its flexibility and simplicity, which better suits my use case, and besides this minor inconvenience of manually having to remove the excess network profiles with regedit on Windows, it works wonderfully.

Here’s a screenshot showing the Windows 10 desktop after the container has just restarted; as far as I know, Windows 11 does not show this type of notification panel.

image

Is there a specific configuration or setting within this container that could help maintain a consistent network profile across reboots? Any suggestions or guidance would be greatly appreciated.

Thank you!

@kroese
Copy link
Collaborator

kroese commented Jun 15, 2024

I never noticed this issue myself, and I also didnt see anyone ever report it before. So it looks like it is specific to your system, but I have no clues as what might be causing it.

I would expect this behaviour for example when the MAC address of the network adaptor changes. But I generate this address a single time, then store it in /storage/qemu.mac and every reboot it re-uses that MAC address that it used previously. So it should not change after a reboot, but maybe you can verify from within Windows if it has the correct MAC.

Besides the MAC address, I do not know what other factors can cause Windows to see the network adaptor as a new device. You can set NETWORK: "user" to enable usermode networking, and see if it changes anything.

Or maybe its related to some Docker settings, that assigns a different subnet/gateway ip for the container each time, causing it to think the network has changed. Its difficult to pinpoint whats going on without knowing exactly what are the conditions that Windows uses to mark a network as new.

@duckIing
Copy link

same problem in win2k22 vm

@kroese kroese closed this as completed Oct 12, 2024
@kroese kroese reopened this Oct 25, 2024
@kroese
Copy link
Collaborator

kroese commented Oct 25, 2024

I also experienced this problem now, with Windows Server 2019.

I have no idea how Windows detects the network device has changed. The MAC address and PCI bus did not change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants