So yeah, I wanna go back to Windows for reasons that are completely out of my hands. But I still cannot even dare to develop my projects in CMD or Powershell, I need to use Ubuntu WSL.
So, my question is: How do I move from Ubuntu Desktop to Ubuntu WSL without having to redo/reconfigure a lot of stuff?
I think moving the home directory alone is not enough, so anyone got any idea out there?
For clarification: I don't think I care about GUI applications since running GUI from WSL is weird. I want to move over any system configurations that can matter in WSL (so not thing like grub, which are non-existent in WSL), my nodejs and npm versions, etcetera.
Unfortunately there's not going to be a great way to do this. I can think of two (and a half) possible options.
Obviously, manually
Back up the Ubuntu installation in a form where you can easily access the files. This is probably going to be something like an
rsync
to an external device. Verify the backup.Set up Ubuntu on WSL, start installing the things you know you want, and then move over the configuration files (and data, if applicable) for those items. You can probably just start by restoring your home directory, yes. That will get you some of the way there.
Expect that you'll probably get a lot of errors initially. If you find that you can't boot into your user profile on WSL because of errors from missing items, you can always access it via
wsl ~ -u root
.Subtractive approach
Not pretty. Work on uninstalling anything graphical on the desktop system to try to turn it (as much as possible) into a "Server" installation. Then back up the system, as root (in single-user mode) using
tar
andwsl --import
that.There's a lot of hand-waving here. Not tested, and I'd prefer the "Manual" version personally.
Option "and-a-half". Use a VM on Windows for starters. This should allow you to migrate from the desktop to Windows more easily. Set up WSL2 and start the "Manual" migration while you have a functioning VM in the meantime.