-
Notifications
You must be signed in to change notification settings - Fork 834
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
Importing a WSL2 distro with wsl --imoprt --vhd
doesn't set default user
#12402
Comments
Logs are required for review from WSL teamIf this a feature request, please reply with '/feature'. If this is a question, reply with '/question'. How to collect WSL logsDownload and execute collect-wsl-logs.ps1 in an administrative powershell prompt:
The script will output the path of the log file once done. If this is a networking issue, please use collect-networking-logs.ps1, following the instructions here Once completed please upload the output files to this Github issue. Click here for more info on logging View similar issuesPlease view the issues below to see if they solve your problem, and if the issue describes your problem please consider closing this one and thumbs upping the other issue to help us prioritize it! Open similar issues:
Closed similar issues:
|
/feature You should be able to export and import a WSL2 image along with its settings bundled together. |
Diagnostic information
|
When transferring a WSL2 Ubuntu distribution between systems, I used the following commands:
First, on the source system to export the distribution:
Then, on the destination system to import it:
wsl --import --vhd Ubuntu-24.04 \ubuntu-24.04.vhdx
After importing the distribution, I noticed two configuration issues that need to be addressed to match the default setup that comes with a Microsoft Store installation.
First, the imported distribution defaults to using the root user instead of a default user account. When installing Ubuntu from the Microsoft Store, it automatically sets up and uses a default user account for all operations.
Second, the shell environment isn't initializing properly. The login shell doesn't start automatically, which means
.profile
and.bashrc
files aren't being loaded at startup. Currently, this requires manually runningbash --login
to get the proper shell environment. In contrast, a Microsoft Store installation handles all of this automatically, providing a properly configured bash login shell that loads all user profile files on startup.The goal is to replicate the Microsoft Store's automatic configuration to achieve the same seamless experience with our imported distribution.
The text was updated successfully, but these errors were encountered: