Windows 10 with macvlan interface?


I installed a Windows 10 vm, following the instructions Running virtual machines with LXD 4.0

I’m wondering if it’s possible to use a macvlan interface with a Windows guest.

I currently get an link local IP ( and not one from my DHCP server. Only thread I could find about that was LXD Windows VM not showing IPV4 address under lxc list

VM config:

$ sudo lxc config show win10
architecture: x86_64
  limits.cpu: "4"
  limits.memory: 4GB
  raw.apparmor: /home/** rwk,
  security.secureboot: "false"
  volatile.eth0.host_name: mac08ced1b1
  volatile.eth0.hwaddr: 00:16:2d:71:e4:a3
  volatile.eth0.last_state.created: "false"
  volatile.last_state.power: RUNNING
  volatile.vm.uuid: 49cff56e-a4a3-41e5-9693-2f7ecb6999cc
    path: /
    pool: lxd_storage
    size: 60GB
    type: disk
ephemeral: false
- default
stateful: false
description: ""

VM profile:

$ sudo lxc profile show default
config: {}
description: Default LXD profile
    nictype: macvlan
    parent: bond0.3
    type: nic
    path: /
    pool: lxd_storage
    type: disk
name: default
- /1.0/instances/win10

I removed the default profile, and decided to add the devices directly to the virtual machine.

This still didn’t work

lxc config device add win10 \
eth0 nic name=eth0 nictype=macvlan parent=bond0.3 type=nic vlan=3

Though it appears using a bridge does:

lxc config device add win10 \
eth0 nic name=eth0 nictype=bridged parent=lxdbr0

The thing is I really don’t want a bridge, I want my windows VM to be another host on the physical network, except it seems Windows only seems to give me a link local.

The macvlan device does work with VMs (technically it sets up what is known as a macvtap, but they are similar).

If the network card is coming up inside the VM, but you cannot do DHCP to the external network, then I would first check that nothing is filtering packets from your VM’s MAC address on your LXD host’s parent port, as that is a common failure scenario.

You should also check with tcpdump command on the LXD host that you can see DHCP broadcast packets leaving your LXD host’s external port from the VM, it may be you have a firewall on the host blocking it.

Weirdly, i removed the interfaces and re-added them and it worked. I think it might have been a mis-configuration on my DHCP server.

Is there any way to get the IP address in the lxc list working? I think that only worked with a bridge.

I did see you wrote something about it here LXD Windows VM not showing IPV4 address under lxc list seems that doesn’t work with the macvlan type.

Thats correct, LXD cannot show the IPs for a Windows VM using macvlan.

The reason for this is as follows:

  • We do not (yet) have support for the lxd-agent inside the Windows VM guest (so it cannot relay the local IP info back to LXD).
  • The LXD host bridge doesn’t mediate traffic between the VM guest and the external network and so their is no ARP/NDP neighbour cache to inspect to ascertain the active IPs associated to the VM guest’s MAC address.

Are there any plans to do this? Just curious. I suppose that would also explain why 9p wasn’t going to work. (Not that that matters, I just used SMB instead).

There are plans for it, I believe there is an issue with either the 9p or virtiofs driver currently.

@monstermunchkin knows more about this.

vsock is the current issue on Windows, there is a skeleton driver at this point but this needs to be completed and signed before we can make use of it for the lxd agent.

Ah, good to know.