Skip to content

Start a distro with fixed MAC address on WSL2 #5291

Open

Description

@honeway

Is your feature request related to a problem? Please describe.
The MAC address of distro changes every time it is started.. Some software license is based on MAC address. Changes will make license unusable.

Describe the solution you'd like
I wish we can have similar option like wsl -d distro --mac xxx.xxx

Activity

  1. therealkenc commented on May 30, 2020

    @therealkenc

    Suggestion was brought up in passing in #4210 (message). Probably would be a .wslconfig thing. The adapter is shared between distros. Ref also #4454.

  2. luxzg commented on Nov 24, 2022

    @luxzg

    Since I just stumbled on this issue, I'd like to point everyone to the fact that macAddress was added as a hidden (undocumented) option in .wslconfig and is available to current stable WSL2 1.0+.

    The discovery was mentioned in issue 4150 and I've tried to document it with other new options the best I could here:
    https://github.com/luxzg/WSL2-fixes

    Hope this information helps someone!

  3. emoxam commented on Dec 16, 2022

    @emoxam

    Well it may be something like that in %UserProfile%/.wslconfig

    [wsl2]
    networkingMode = bridged
    vmSwitch = Ext
    macAddress=5c:bb:f6:9e:ee:55

  4. luxzg commented on Dec 21, 2022

    @luxzg

    Exactly, as I said above.

    But due to setting relying on additional setup and OS requirements, putting just config snippet here isn't telling whole story.

    Anyway, yes that's the setting, you just need Hyper-V vSwitch, that requires Hyper-V, that requires Win 11 Pro, and several setup/config steps before and after setting this in wslconfig.

    Thus for full story read guide linked in my comment above, so I don't need to copy paste the whole workflow in every issue thread these settings solve.

    Btw do not fear, if you have W11 Pro with Hyper-V, getting WSL2 to proper networking is 5-10min setup.

  5. micheldiemer commented on Apr 18, 2024

    @micheldiemer

    Here a detailed working procedure on how to use WSLAttachSwitch

    Script : #4799 (comment)

    Text : #4799 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions