chore: link vault wiki to Gitea
This commit is contained in:
101
01-linux/distro-specific/wsl2-instance-migration-fedora43.md
Normal file
101
01-linux/distro-specific/wsl2-instance-migration-fedora43.md
Normal file
@@ -0,0 +1,101 @@
|
||||
---
|
||||
title: WSL2 Instance Migration (Fedora 43)
|
||||
domain: linux
|
||||
category: distro-specific
|
||||
tags:
|
||||
- wsl2
|
||||
- fedora
|
||||
- windows
|
||||
- migration
|
||||
- majorrig
|
||||
status: published
|
||||
created: '2026-03-06'
|
||||
updated: '2026-03-08'
|
||||
---
|
||||
|
||||
# WSL2 Instance Migration (Fedora 43)
|
||||
|
||||
To move a WSL2 distro from C: to another drive, export it to a tar file with `wsl --export`, unregister the original, then re-import it at the new location with `wsl --import`. After import you'll need to fix the default user — WSL always resets it to root on import, which you patch via `/etc/wsl.conf`.
|
||||
|
||||
## The Short Answer
|
||||
|
||||
```powershell
|
||||
wsl --terminate Fedora-43
|
||||
wsl --export Fedora-43 D:\fedora_backup.tar
|
||||
wsl --unregister Fedora-43
|
||||
mkdir D:\WSL\Fedora43
|
||||
wsl --import Fedora-43 D:\WSL\Fedora43 D:\fedora_backup.tar --version 2
|
||||
```
|
||||
|
||||
Then fix the default user — see Steps below.
|
||||
|
||||
## Background
|
||||
|
||||
WSL2 stores each distro as a VHDX on whatever drive it was installed to, which is C: by default. If you're running Unsloth fine-tuning runs or doing anything that generates large files in WSL2, C: fills up fast. The migration is straightforward but the import resets your default user to root, which you have to fix manually.
|
||||
|
||||
## Steps
|
||||
|
||||
1. Shut down the instance cleanly
|
||||
|
||||
```powershell
|
||||
wsl --terminate Fedora-43
|
||||
```
|
||||
|
||||
2. Export to the destination drive
|
||||
|
||||
```powershell
|
||||
wsl --export Fedora-43 D:\fedora_backup.tar
|
||||
```
|
||||
|
||||
3. Remove the C: instance
|
||||
|
||||
```powershell
|
||||
wsl --unregister Fedora-43
|
||||
```
|
||||
|
||||
4. Create the new directory and import
|
||||
|
||||
```powershell
|
||||
mkdir D:\WSL\Fedora43
|
||||
wsl --import Fedora-43 D:\WSL\Fedora43 D:\fedora_backup.tar --version 2
|
||||
```
|
||||
|
||||
5. Fix the default user and enable systemd — edit `/etc/wsl.conf` inside the distro
|
||||
|
||||
```ini
|
||||
[boot]
|
||||
systemd=true
|
||||
|
||||
[user]
|
||||
default=majorlinux
|
||||
```
|
||||
|
||||
6. Restart WSL to apply
|
||||
|
||||
```powershell
|
||||
wsl --shutdown
|
||||
wsl -d Fedora-43
|
||||
```
|
||||
|
||||
## Gotchas & Notes
|
||||
|
||||
- **Default user always resets to root on import** — this is expected WSL behavior. The `/etc/wsl.conf` fix is mandatory, not optional.
|
||||
- **Windows Terminal profiles:** If the GUID changed after re-registration, update the profile. The command line stays the same: `wsl.exe -d Fedora-43`.
|
||||
- **Verify the VHDX landed correctly:** Check `D:\WSL\Fedora43\ext4.vhdx` exists before deleting the backup tar.
|
||||
- **Keep the tar until verified:** Don't delete `D:\fedora_backup.tar` until you've confirmed the migrated instance works correctly.
|
||||
- **systemd=true is required for Fedora 43** — without it, services (including Docker and Ollama in WSL) won't start properly.
|
||||
|
||||
## Maintenance Aliases (DNF5)
|
||||
|
||||
Fedora 43 ships with DNF5. Add these to `~/.bashrc`:
|
||||
|
||||
```bash
|
||||
alias update='sudo dnf upgrade --refresh'
|
||||
alias install='sudo dnf install'
|
||||
alias clean='sudo dnf clean all'
|
||||
```
|
||||
|
||||
## See Also
|
||||
|
||||
- [[Managing disk space on MajorRig]]
|
||||
- [[Unsloth QLoRA fine-tuning setup]]
|
||||
Reference in New Issue
Block a user