Ankit Kumar’s Post

Got a new laptop last week. Usually this means: reinstall Python, recreate conda environment, pip install everything again, install dependencies, lose half a day. This time I didn't do any of that. I just copied my entire WSL environment from the old machine to the new one: libraries, virtual environments, configs. Opened the terminal on the new laptop and it worked like nothing changed. Here's how: 1. On the old laptop, export the WSL distro: wsl --export Ubuntu D:\Ubuntu_backup.tar 2. Transfer the .tar file to the new laptop with pen drive. 3. On the new laptop, install WSL, then import: wsl --import Ubuntu C:\WSL\Ubuntu D:\Ubuntu_backup.tar 4. Log in with root user: ubuntu config --default-user <your_username> Done. All my Python environments, pip packages, project files remains intact. Zero reinstallation. The .tar file was heavy (7+ GB ), but it saved hours of setup. If you work on WSL and switch machines often, this is the way. #WSL #Python #DevTools #Productivity #Linux

To view or add a comment, sign in

Explore content categories