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

Ubuntu Subsystem Backup and reinstall in new/clean win10 Installation #2955

Closed
SvenBudak opened this issue Feb 15, 2018 · 26 comments
Closed

Comments

@SvenBudak
Copy link

Hi,

Is it possible to backup my Ubuntu Subsystem from 1 Computer and re-import it on one of my other machines?

And is a feature planed where the Subsystem can be synct via OneDrive between all machines?

@fpqc
Copy link

fpqc commented Feb 15, 2018

It's suggested to backup your user home directory and then reinstall, copy the home back in, and fix the permissions.

@SvenBudak
Copy link
Author

Is there any way to let the permissions autofix? i am not really good with linux. i am happy that i make it running on this one machine ;)

@Biswa96
Copy link

Biswa96 commented Feb 15, 2018

@BamiGorengo Do you have any external HDD or SSD? I've some idea.

@SvenBudak
Copy link
Author

i can get one yes. but my plan was to backup the complete "CanonicalGroupLimited.UbuntuonWindows_79rhkp1fndgsc" folder in a zip file, upload it on my cloud and download it on my other computer. then i install ubuntu from the App-Store and repleace the folder.

you think this can work? and what is with permissions then? they are all broken after i did this?

@fpqc
Copy link

fpqc commented Feb 15, 2018

no, zip will kill the permissions 🙄

@SvenBudak
Copy link
Author

hmmmm... then letz wait for Biswa96. he have some idea :)

@Biswa96
Copy link

Biswa96 commented Feb 15, 2018

No, your step does not work. My step will be like: you install in external drive > backup a simple registry ( ~2KB) > Connect the drive anywhere > Just import the registry.
If you want to upload/download WSL, then you follow @bitcrazed answer in this link: https://superuser.com/a/1199498/726810 or see this issue #2567

@SvenBudak
Copy link
Author

Oh.. Thanks, but i think i dont understand Richard Turner`s Tutorial. Maybe i better wait for a solution from Microsoft. Hope for a OneDrive Solution.

@fpqc
Copy link

fpqc commented Feb 15, 2018

You can use tar and untar on the current directory.

@bitcrazed
Copy link
Contributor

@BamiGorengo - Please avoid spelunking around in WSL's folders - there be dragons!

Also, the folder you were proposing copying between machines contains the entire userspace - this is overkill and is unlikely to work well as a backup mechanism.

Instead, focus on copying your settings, home folder, and (if necessary) generating the list of currently installed packages, so that you can export/copy that list to restore onto a fresh new instance of the same distro. The first answer to this AskUbuntu question should help: https://askubuntu.com/questions/9135/how-to-backup-settings-and-list-of-installed-packages

@Biswa96
Copy link

Biswa96 commented Feb 15, 2018

@bitcrazed One can fix the permission with NtSetEaFile() function. This LXATTRB extended attribute can be added to wsl.exe so that user can fix file/folder/hard link permissions.

@bitcrazed
Copy link
Contributor

It's not just about permissions. There are other potential issues caused by unexpected file locking semantics, etc. We are working to improve Windows --> Linux filesystem interop in future releases and, in the meantime, encourage users to avoid spelunking into the Linux filesystem via Windows and Windows apps/tools.

@Biswa96
Copy link

Biswa96 commented Feb 16, 2018

In this context, I thought if WSL can be backed up in a Virtual Hard Disk file (.vhd). Can WSL be install in a vhd file?

@WSLUser
Copy link

WSLUser commented Feb 16, 2018

@Biswa96 asking for WSL install via .vhd? Next we'll be asking for a .iso installation.

@bitcrazed
Copy link
Contributor

bitcrazed commented Feb 17, 2018

Today, the only place we support installing WSL distros on Client OS' is to the locations controlled, managed, and configured via the built-in infrastructure.

While you MIGHT be able to install distros elsewhere, you do so at your own risk ;)

Similarly, I don't believe we support installing distro's to magnetic tape drives, Hollerith punched card machines, or Jacquard looms ;)

@fpqc
Copy link

fpqc commented Feb 17, 2018

I wonder if with serial support you can now display WSL on a teletype machine 🤔

I've seen it done with bare metal linux on youtube.

@bitcrazed
Copy link
Contributor

Give it a try and let us know how you get on :D

@SvenBudak
Copy link
Author

The Problem is that my english is really bad, i cant follow all informations that i get in replys in this issue... And when i need to google to solve to much terminal and linux permission problems that i dont understand... it will ends in chaos :D The only way is a "drag & drop" solution. i checked docker because i hoped that i can mount that image so easy like mounting images with deamon tools... but that seems not so easy like i hoped... ;P

@therealkenc
Copy link
Collaborator

Ran course.

@abalter
Copy link

abalter commented Dec 17, 2018

@BeErikk
Copy link

BeErikk commented May 25, 2019

If anyone wonders more about this, I've installed WSL on a virtual drive through the server installation method on Windows 10. It's been running without any problems since July 2018. I have the drive automount at computer start. As far as I've seen Windows is not depended on any WSL services before the automount. I will reinstall a clean Windows at the coming Windows update, so I will have to find a way to reattach my WSL drive. The virtual drive file can without issue be moved anywhere, backed up etc, even mounted from your network. The file is currently ~5GB.

@Venipa
Copy link

Venipa commented Jun 8, 2019

wsl --export <Distro> <filepath (ex: ./debian-development.wsl)>
on new machine wsl --import <filepath to your backup)

may take a while. made an dev env with this super handy stored my ssh keys etc there.
i hope im not to late

@abalter
Copy link

abalter commented Jun 8, 2019

@Venipa -- what is <Distro> here? How does Windows name your WSL?

@abalter
Copy link

abalter commented Jun 8, 2019

@Venipa -- I don't see an --export option.

C:\Users\ariel>wsl --help
Usage: wsl.exe [option] ...
Options:
    -d, --distribution <DistributionName>
        Launch the specified distribition.

    -e, --exec <CommandLine>
        Execute the specified Linux command. The remainder of the arguments are
        used as the command line to execute.

    -u, --user <UserName>
        Run as the specified user.

    --help
        Display this usage information.

    --
        Stop parsing arguments and pass the remainder to the Linux process.

@abalter
Copy link

abalter commented Jun 8, 2019

Hmmm. I think I may need to update Windows to get this feature. I'll report back.

@Venipa
Copy link

Venipa commented Jun 8, 2019


currently on 20h1 but i know its in 19h1

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

No branches or pull requests

10 participants