#Move Ubuntu subsystem
1 messages · Page 1 of 1 (latest)
Yep. We can do this safely, one step at a time. For WSL, the least risky path is export Ubuntu to a tar backup, import it onto D:, verify it boots and OpenClaw still works, then only later remove the old C: copy. No deleting in the early steps.
Before we touch anything, Step 1 is just inventory.
Open PowerShell and run these, then paste the output:
wsl --version
wsl --list --verbose
wsl --status
Then inside your Ubuntu terminal, run:
openclaw --version
pwd
df -h ~
Don’t run any unregister/delete commands yet. Especially avoid wsl --unregister Ubuntu until the D: copy is fully verified.
Reference for the WSL export/import approach: https://learn.microsoft.com/en-us/windows/wsl/basic-commands#import-and-export-a-distribution
OpenClaw troubleshooting docs, in case we need them after the move: https://docs.openclaw.ai/help/troubleshooting
Step by step, one step at a time with paste output mode
Got it. We’ll do one step per message, and after each step you paste the output before I give the next one.
Step 1: identify your WSL distro name
Open PowerShell and run only this:
wsl --list --verbose
Paste the full output here.
PS C:\WINDOWS\system32> wsl --list --verbose NAME STATE VERSION * Ubuntu-24.04 Running 2
Good. Your distro name is Ubuntu-24.04.
Step 2: check D: has enough free space
In PowerShell, run only this:
Get-Volume -DriveLetter D | Select-Object DriveLetter,FileSystemLabel,SizeRemaining,Size | Format-List
Paste the full output here.
DriveLetter : D
FileSystemLabel : SSD
SizeRemaining : 44364877824
Size : 484665581568```
D: has about 41.3 GiB free. Before exporting, we need to confirm Ubuntu’s used size fits comfortably.
Step 3: check how much Ubuntu is using
In PowerShell, run only this:
wsl -d Ubuntu-24.04 -- df -h /
Paste the full output here.
Filesystem Size Used Avail Use% Mounted on
/dev/sdd 1007G 12G 945G 2% /```
Good, Ubuntu is only using about 12 GB, so D: has enough room for the export plus the imported copy.
Step 4: stop WSL cleanly
Close any Ubuntu/OpenClaw terminals first. Then in PowerShell, run only this:
wsl --shutdown
It may print nothing. After it finishes, run:
wsl --list --verbose
Paste the output of the second command here.
PS C:\WINDOWS\system32> wsl --list --verbose
NAME STATE VERSION
* Ubuntu-24.04 Stopped 2```
Perfect. WSL is stopped, so the export will be consistent.
Step 5: create the folders on D:
In PowerShell, run only this:
New-Item -ItemType Directory -Force D:\WSL\Backups, D:\WSL\Ubuntu-24.04
Paste the full output here.
Directory: D:\WSL
Mode LastWriteTime Length Name
---- ------------- ------ ----
d----- 5/17/2026 5:26 PM Backups
d----- 5/17/2026 5:26 PM Ubuntu-24.04```
Good.
Step 6: export Ubuntu to a backup tar on D:
In PowerShell, run only this:
wsl --export Ubuntu-24.04 D:\WSL\Backups\Ubuntu-24.04-backup.tar
This can take several minutes and may show no progress. When it finishes, paste whatever PowerShell shows after the command completes.
Export in progress, this may take a few minutes. (10999 MB)
The operation completed successfully.```
Nice, the backup export succeeded.
Step 7: verify the backup file exists and its size
In PowerShell, run only this:
Get-Item D:\WSL\Backups\Ubuntu-24.04-backup.tar | Select-Object FullName,Length | Format-List
Paste the full output here.
FullName : D:\WSL\Backups\Ubuntu-24.04-backup.tar
Length : 11533885440```
Backup looks right: about 10.7 GiB.
Step 8: import the D: copy as a temporary new distro
This does not delete or change the old C: Ubuntu. It creates a second copy named Ubuntu-24.04-D.
In PowerShell, run only this:
wsl --import Ubuntu-24.04-D D:\WSL\Ubuntu-24.04 D:\WSL\Backups\Ubuntu-24.04-backup.tar --version 2
When it finishes, paste the full output here. It may show no output if successful.
FullName : D:\WSL\Backups\Ubuntu-24.04-backup.tar
Length : 11533885440
PS C:\WINDOWS\system32> wsl --import Ubuntu-24.04-D D:\WSL\Ubuntu-24.04 D:\WSL\Backups\Ubuntu-24.04-backup.tar --version 2
The operation completed successfully.```
Good, the D: import succeeded.
Step 9: confirm both distros are registered
In PowerShell, run only this:
wsl --list --verbose
Paste the full output here.
NAME STATE VERSION
* Ubuntu-24.04 Running 2
Ubuntu-24.04-D Stopped 2```
Both are registered. The old one started again, but that’s okay.
Step 10: boot the D: copy and check its Linux user
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- sh -lc "whoami; pwd; ls /home"
Paste the full output here.
Failed to attach disk 'D:\WSL\Ubuntu-24.04\ext4.vhdx' to WSL2: The process cannot access the file because it is being used by another process.
Error code: Wsl/Service/CreateInstance/MountDisk/HCS/ERROR_SHARING_VIOLATION```
That error means Windows still has the new ext4.vhdx file locked. Usually a clean WSL shutdown clears it.
Step 10a: shut WSL down again
Close any Ubuntu windows first. Then in PowerShell, run only this:
wsl --shutdown
Wait about 10 seconds, then run:
wsl --list --verbose
Paste the output of the second command here.
PS C:\WINDOWS\system32> wsl --list --verbose
NAME STATE VERSION
- Ubuntu-24.04 Stopped 2
Ubuntu-24.04-D Stopped 2
That looks like an auth token/JWT, not the WSL output. For safety, you should delete that message if Discord lets you, and treat the token as exposed: log out/revoke/regenerate it in whatever app issued it.
Back to the WSL move: please run the last step again and paste only this output:
wsl --list --verbose
No tokens, passwords, or browser/app auth strings.
Good, both are stopped now.
Step 10b: try starting the D: copy again
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- sh -lc "whoami; pwd; ls /home"
Paste the full output here.
Failed to attach disk 'D:\WSL\Ubuntu-24.04\ext4.vhdx' to WSL2: The process cannot access the file because it is being used by another process.
Error code: Wsl/Service/CreateInstance/MountDisk/HCS/ERROR_SHARING_VIOLATION
PS C:\WINDOWS\system32>```
Still locked. That usually means a Windows process has the new VHDX open, or the WSL service did not fully release it.
Step 10c: restart the WSL service
Close Ubuntu, VS Code, Docker Desktop, and any File Explorer window open inside D:\WSL.
Then open PowerShell as Administrator and run only this:
Restart-Service LxssManager
Paste the full output here. If it prints nothing, just say “no output”.
PS C:\WINDOWS\system32> Restart-Service LxssManager
Restart-Service : Cannot find any service with service name 'LxssManager'.
At line:1 char:1
- Restart-Service LxssManager
-
+ CategoryInfo : ObjectNotFound: (LxssManager:String) [Restart-Service], ServiceCommandException + FullyQualifiedErrorId : NoServiceFoundForGivenName,Microsoft.PowerShell.Commands.RestartServiceCommand
Okay, this Windows install doesn’t expose LxssManager under that name. Let’s identify the WSL service name first.
Step 10d: list WSL-related services
In PowerShell as Administrator, run only this:
Get-Service | Where-Object { $_.Name -match 'wsl|lxss|hns|vmcompute' -or $_.DisplayName -match 'wsl|linux|hyper-v|host network' } | Select-Object Name,DisplayName,Status | Format-Table -AutoSize
Paste the full output here.
PS C:\WINDOWS\system32> Get-Service | Where-Object { $.Name -match 'wsl|lxss|hns|vmcompute' -or $.DisplayName -match 'wsl|linux|hyper-v|host network' } | Select-Object Name,DisplayName,Status | Format-Table -AutoSize
Name DisplayName Status
hns Host Network Service Running
vmcompute Hyper-V Host Compute Service Running
vmicguestinterface Hyper-V Guest Service Interface Stopped
vmicheartbeat Hyper-V Heartbeat Service Stopped
vmickvpexchange Hyper-V Data Exchange Service Stopped
vmicrdv Hyper-V Remote Desktop Virtualization Service Stopped
vmicshutdown Hyper-V Guest Shutdown Service Stopped
vmictimesync Hyper-V Time Synchronization Service Stopped
vmicvmsession Hyper-V PowerShell Direct Service Stopped
vmicvss Hyper-V Volume Shadow Copy Requestor Stopped
vmms Hyper-V Virtual Machine Management Running
WSLService WSL Service Running
Found it: your service is WSLService.
Step 10e: restart WSLService
In PowerShell as Administrator, run only this:
Restart-Service WSLService
Then wait 10 seconds and run:
wsl --list --verbose
Paste the output of the second command here.
PS C:\WINDOWS\system32> Restart-Service WSLService
PS C:\WINDOWS\system32> wsl --list --verbose
NAME STATE VERSION
- Ubuntu-24.04 Stopped 2
Ubuntu-24.04-D Stopped 2
Good. Service restart completed and both distros are stopped.
Step 10f: try the D: copy again
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- sh -lc "whoami; pwd; ls /home"
Paste the full output here.
PS C:\WINDOWS\system32> wsl -d Ubuntu-24.04-D -- sh -lc "whoami; pwd; ls /home"
Failed to attach disk 'D:\WSL\Ubuntu-24.04\ext4.vhdx' to WSL2: The process cannot access the file because it is being used by another process.
Error code: Wsl/Service/CreateInstance/MountDisk/HCS/ERROR_SHARING_VIOLATION
The lock survived a WSL service restart, so the next clean step is a Windows reboot. That is safer than trying random force-unlock commands.
Step 10g: reboot Windows
Restart the PC normally from the Start menu. After reboot, open PowerShell and run only this:
wsl --list --verbose
Paste the output here before trying to start either Ubuntu.
NAME STATE VERSION
* Ubuntu-24.04 Running 2
Ubuntu-24.04-D Stopped 2```
The original Ubuntu started automatically after reboot. We need it stopped before testing the D: copy.
Step 10h: stop WSL again
In PowerShell, run only this:
wsl --shutdown
Then run:
wsl --list --verbose
Paste the output of the second command here.
Because I'm using task scedudler to load it auto so openclaw can run
That explains it. Task Scheduler is starting the old Ubuntu-24.04, which can keep WSL busy while we’re trying to test the D: copy.
Step 10i: temporarily disable that scheduled task
Open Task Scheduler, find the task that starts OpenClaw/Ubuntu, right-click it, choose Disable.
Then in PowerShell, run only this:
wsl --shutdown
wsl --list --verbose
Paste the output here.
We’ll re-enable or update the task after the D: copy is verified. Don’t delete the task, just disable it for now.
>> wsl --list --verbose
NAME STATE VERSION
* Ubuntu-24.04 Stopped 2
Ubuntu-24.04-D Stopped 2```
Good. Both are stopped and the scheduled task should no longer interfere.
Step 10j: start the D: copy
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- sh -lc "whoami; pwd; ls /home"
Paste the full output here.
PS C:\WINDOWS\system32> wsl -d Ubuntu-24.04-D -- sh -lc "whoami; pwd; ls /home"
wrakeeb
/mnt/c/WINDOWS/system32
linuxbrew wrakeeb
Good, the D: copy boots and your user is wrakeeb.
Step 11: check OpenClaw inside the D: copy
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- bash -lc "cd ~ && pwd && openclaw --version && which openclaw"
Paste the full output here.
S C:\WINDOWS\system32> wsl -d Ubuntu-24.04-D -- bash -lc "cd ~ && pwd && openclaw --version && which openclaw"
/home/wrakeeb
bash: line 1: openclaw: command not found
That means the D: copy itself is booting, but the shell PATH for openclaw isn’t resolving yet. We’ll locate where it’s installed before changing anything.
Step 12: search common install locations inside the D: copy
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- bash -lc "cd ~; echo PATH=$PATH; command -v node npm pnpm openclaw || true; ls -la ~/.npm-global/bin ~/.local/bin /home/linuxbrew/.linuxbrew/bin 2>/dev/null | grep -E 'openclaw|clawdbot|node|npm|pnpm' || true"
Paste the full output here.
PS C:\WINDOWS\system32> wsl -d Ubuntu-24.04-D -- bash -lc "cd ~; echo PATH=$PATH; command -v node npm pnpm openclaw || true; ls -la ~/.npm-global/bin ~/.local/bin /home/linuxbrew/.linuxbrew/bin 2>/dev/null | grep -E 'openclaw|clawdbot|node|npm|pnpm' || true"
PATH=
/usr/bin/node
/usr/bin/npm
/home/wrakeeb/.npm-global/bin:
lrwxrwxrwx 1 wrakeeb wrakeeb 41 May 17 13:01 openclaw -> ../lib/node_modules/openclaw/openclaw.mjs
Found it. OpenClaw is installed at /home/wrakeeb/.npm-global/bin/openclaw; it’s just not on PATH in that command.
Step 13: run OpenClaw using the full path
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- /home/wrakeeb/.npm-global/bin/openclaw --version
Paste the full output here.
wsl -d Ubuntu-24.04-D -- /home/wrakeeb/.npm-global/bin/openclaw --version
Looks like you pasted the command itself, not the result.
Run it in PowerShell:
wsl -d Ubuntu-24.04-D -- /home/wrakeeb/.npm-global/bin/openclaw --version
Then paste the output that appears underneath it.
OpenClaw 2026.5.4 (325df3e)
PS C:\WINDOWS\system32>```
Good. OpenClaw is present in the D: copy: OpenClaw 2026.5.4.
Step 14: run a basic OpenClaw health/status check from the D: copy
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- /home/wrakeeb/.npm-global/bin/openclaw status
Paste the full output here.
Good: the D: copy has OpenClaw, config, sessions, channels, and the systemd user service installed.
The only problem shown is: Gateway service says running, but gateway port is unreachable. We’ll inspect that before changing anything.
Step 15: check gateway service details
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- /home/wrakeeb/.npm-global/bin/openclaw gateway status
Paste the full output here.
🦞 OpenClaw 2026.5.4 (325df3e) — Your personal assistant, minus the passive-aggressive calendar reminders.
│
â—‡
Service: systemd user (enabled)
File logs: /tmp/openclaw/openclaw-2026-05-17.log
Command: /usr/bin/node /home/wrakeeb/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 287, state active, sub running, last exit 0, reason 0)
Warm-up: launch agents can take a few seconds. Try again shortly.
Connectivity probe: failed
Probe target: ws://127.0.0.1:18789
connect ECONNREFUSED 127.0.0.1:18789
Capability: unknown
Gateway port 18789 is not listening (service appears running).
Logs: journalctl --user -u openclaw-gateway.service -n 200 --no-pager
Restart log: ~/.openclaw/logs/gateway-restart.log
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting```
The service wrapper is running, but the gateway process is not actually listening. Next we need the service log.
Step 16: read the gateway service log
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- bash -lc "journalctl --user -u openclaw-gateway.service -n 80 --no-pager"
Paste the full output here.
The log is useful: OpenClaw is starting successfully, then it receives SIGTERM and shuts down. That usually means WSL is being stopped/going idle while we’re checking it, not that OpenClaw itself failed.
Step 17: keep the D: distro alive long enough, then check again
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- bash -lc "sleep 35; /home/wrakeeb/.npm-global/bin/openclaw gateway status"
Paste the full output here.
PS C:\WINDOWS\system32> wsl -d Ubuntu-24.04-D -- bash -lc "sleep 35; /home/wrakeeb/.npm-global/bin/openclaw gateway status"
🦞 OpenClaw 2026.5.4 (325df3e) — Type the command with confidence—nature will provide the stack trace if needed.
│
â—‡
Service: systemd user (enabled)
File logs: /tmp/openclaw/openclaw-2026-05-17.log
Command: /usr/bin/node /home/wrakeeb/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 283, state active, sub running, last exit 0, reason 0)
Connectivity probe: ok
Capability: admin-capable
Listening: 127.0.0.1:18789
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
Good. The D: copy is healthy now: gateway is listening and the probe is OK.
Next we need to update your autostart task so it starts Ubuntu-24.04-D instead of the old C: distro.
Step 18: find the Task Scheduler task
In PowerShell, run only this:
Get-ScheduledTask | Where-Object { $_.TaskName -match 'openclaw|ubuntu|wsl|claw' -or $_.TaskPath -match 'openclaw|ubuntu|wsl|claw' } | Select-Object TaskName,TaskPath,State | Format-Table -AutoSize
Paste the full output here.
TaskName TaskPath State
-------- -------- -----
OpenClaw AutoStart \ Disabled```
Good, task found and still disabled.
Step 19: inspect exactly what the task runs
In PowerShell, run only this:
(Get-ScheduledTask -TaskName "OpenClaw AutoStart").Actions | Format-List *
Paste the full output here.
OpenClaw AutoStart \ Disabled
PS C:\WINDOWS\system32> (Get-ScheduledTask -TaskName "OpenClaw AutoStart").Actions | Format-List *
Id :
Arguments : "C:\Users\rakib\start-openclaw-hidden.vbs"
Execute : wscript
WorkingDirectory :
PSComputerName :
CimClass : Root/Microsoft/Windows/TaskScheduler:MSFT_TaskExecAction
CimInstanceProperties : {Id, Arguments, Execute, WorkingDirectory}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties```
The scheduled task runs a VBS script. We need to inspect that script before editing it.
Step 20: show the script contents
In PowerShell, run only this:
Get-Content "C:\Users\rakib\start-openclaw-hidden.vbs"
Paste the full output here.
WshShell.Run "wsl.exe bash -c ""~/start-openclaw.sh""", 0, False```
That script uses the default distro because it doesn’t specify -d. We’ll update it to explicitly use the D: copy, but first inspect the Linux startup script.
Step 21: show the OpenClaw startup script in the D: copy
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- bash -lc "cat ~/start-openclaw.sh"
Paste the full output here.
PS C:\WINDOWS\system32> wsl -d Ubuntu-24.04-D -- bash -lc "cat ~/start-openclaw.sh"
Failed to attach disk 'D:\WSL\Ubuntu-24.04\ext4.vhdx' to WSL2: The process cannot access the file because it is being used by another process.
Error code: Wsl/Service/CreateInstance/MountDisk/HCS/ERROR_SHARING_VIOLATION
The D: VHDX is locked again. Before we touch scripts, we need to see which distro is running now.
Step 21a: check WSL state
In PowerShell, run only this:
wsl --list --verbose
Paste the full output here.
What are we exactly doing right now? How long left of all these?
We’ve already done the big risky part:
- Exported your old
Ubuntu-24.04from C: into a backup tar on D: - Imported it as a new distro:
Ubuntu-24.04-D - Confirmed the D: copy boots
- Confirmed OpenClaw exists there
- Confirmed OpenClaw gateway can run correctly there
What we’re doing now is the final wiring: your Windows Task Scheduler autostart still points at the default WSL distro, so it can accidentally start the old C: copy. We’re updating/validating that startup path so it launches Ubuntu-24.04-D instead.
Roughly left:
- Update the VBS autostart script to use
wsl.exe -d Ubuntu-24.04-D ... - Re-enable the scheduled task
- Reboot/test once
- Set
Ubuntu-24.04-Das default if you want - Keep the old C: distro and backup for a while; only delete later after you’re fully confident
Time left: probably 10-20 minutes if the VHDX lock stops fighting us. If the lock keeps recurring, the practical answer is one more reboot after we edit the startup script. We are very close; I’m intentionally not deleting the old distro today.
NAME STATE VERSION
* Ubuntu-24.04 Stopped 2
Ubuntu-24.04-D Stopped 2```
Good, both are stopped.
Step 22: back up the Windows autostart script
In PowerShell, run only this:
Copy-Item "C:\Users\rakib\start-openclaw-hidden.vbs" "C:\Users\rakib\start-openclaw-hidden.vbs.bak"
Then run:
Get-Item "C:\Users\rakib\start-openclaw-hidden.vbs.bak" | Select-Object FullName,Length | Format-List
Paste the output of the second command here.
PS C:\WINDOWS\system32> Get-Item "C:\Users\rakib\start-openclaw-hidden.vbs.bak" | Select-Object FullName,Length | Format-List
FullName : C:\Users\rakib\start-openclaw-hidden.vbs.bak
Length : 110```
Backup exists.
Step 23: update the VBS script to target the D: distro
In PowerShell, run only this:
@'
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "wsl.exe -d Ubuntu-24.04-D bash -lc ""~/start-openclaw.sh""", 0, False
'@ | Set-Content -Encoding ASCII "C:\Users\rakib\start-openclaw-hidden.vbs"
Then run:
Get-Content "C:\Users\rakib\start-openclaw-hidden.vbs"
Paste the output of the second command here.
PS C:\WINDOWS\system32> @'
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "wsl.exe -d Ubuntu-24.04-D bash -lc ""~/start-openclaw.sh""", 0, False
'@ | Set-Content -Encoding ASCII "C:\Users\rakib\start-openclaw-hidden.vbs"
PS C:\WINDOWS\system32> Get-Content "C:\Users\rakib\start-openclaw-hidden.vbs"
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "wsl.exe -d Ubuntu-24.04-D bash -lc ""~/start-openclaw.sh""", 0, False
Good. The Windows autostart script now targets Ubuntu-24.04-D.
Step 24: verify the Linux startup script exists and is executable enough
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- bash -lc "ls -l ~/start-openclaw.sh && sed -n '1,40p' ~/start-openclaw.sh"
Paste the full output here.
Failed to attach disk 'D:\WSL\Ubuntu-24.04\ext4.vhdx' to WSL2: The process cannot access the file because it is being used by another process.
Error code: Wsl/Service/CreateInstance/MountDisk/HCS/ERROR_SHARING_VIOLATION
The D: distro is locked again, likely because the gateway/service is still alive from the previous check. That’s okay; we’ll stop just the D: distro cleanly.
Step 24a: terminate the D: distro only
In PowerShell, run only this:
wsl --terminate Ubuntu-24.04-D
wsl --list --verbose
Paste the output here.
The operation completed successfully.
NAME STATE VERSION
- Ubuntu-24.04 Stopped 2
Ubuntu-24.04-D Stopped 2
PS C:\WINDOWS\system32>
Good. Both are stopped again.
Step 24b: retry checking the Linux startup script
In PowerShell, run only this:
wsl -d Ubuntu-24.04-D -- bash -lc "ls -l ~/start-openclaw.sh && sed -n '1,40p' ~/start-openclaw.sh"
Paste the full output here.
Failed to attach disk 'D:\WSL\Ubuntu-24.04\ext4.vhdx' to WSL2: The process cannot access the file because it is being used by another process.
Error code: Wsl/Service/CreateInstance/MountDisk/HCS/ERROR_SHARING_VIOLATION```
The lock is persistent again. Since wsl --terminate didn’t release it, restart the WSL service one more time now that the autostart script is already fixed.
Step 24c: restart WSLService again
In PowerShell as Administrator, run only this:
Restart-Service WSLService
Then wait 10 seconds and run:
wsl --list --verbose
Paste the output of the second command here.
PS C:\WINDOWS\system32> Restart-Service WSLService
PS C:\WINDOWS\system32> wsl --list --verbose
NAME STATE VERSION
- Ubuntu-24.04 Stopped 2
Ubuntu-24.04-D Stopped 2
Good. Let’s skip the script inspection for now; we already verified the VBS edit and OpenClaw works in D:. The remaining meaningful test is the scheduled task.
Step 25: enable the scheduled task
In PowerShell, run only this:
Enable-ScheduledTask -TaskName "OpenClaw AutoStart"
Then run:
Get-ScheduledTask -TaskName "OpenClaw AutoStart" | Select-Object TaskName,State | Format-List
Paste the output of the second command here.
TaskPath TaskName State
-------- -------- -----
\ OpenClaw AutoStart Ready
PS C:\WINDOWS\system32> Get-ScheduledTask -TaskName "OpenClaw AutoStart" | Select-Object TaskName,State | Format-List
TaskName : OpenClaw AutoStart
State : Ready```
Good. The task is enabled.
Step 26: run the scheduled task manually
In PowerShell, run only this:
Start-ScheduledTask -TaskName "OpenClaw AutoStart"
Wait 45 seconds, then run:
wsl --list --verbose
Paste the output of the second command here.
PS C:\WINDOWS\system32> wsl --list --verbose
NAME STATE VERSION
* Ubuntu-24.04 Stopped 2
Ubuntu-24.04-D Stopped 2
PS C:\WINDOWS\system32> Enable-ScheduledTask -TaskName "OpenClaw AutoStart"
TaskPath TaskName State
-------- -------- -----
\ OpenClaw AutoStart Ready
PS C:\WINDOWS\system32> Get-ScheduledTask -TaskName "OpenClaw AutoStart" | Select-Object TaskName,State | Format-List
TaskName : OpenClaw AutoStart
State : Ready
PS C:\WINDOWS\system32>```
You pasted the previous step output; no problem.
Step 26 again: actually start the task
In PowerShell, run only this:
Start-ScheduledTask -TaskName "OpenClaw AutoStart"
Wait 45 seconds, then run:
wsl --list --verbose
Paste the output of the second command here.
PS C:\WINDOWS\system32> Start-ScheduledTask -TaskName "OpenClaw AutoStart"
PS C:\WINDOWS\system32> wsl --list --verbose
NAME STATE VERSION
- Ubuntu-24.04 Stopped 2
Ubuntu-24.04-D Stopped 2
The task ran but did not start either distro, so the scheduled task/script path is not launching successfully yet.
Step 27: check the scheduled task result code
In PowerShell, run only this:
Get-ScheduledTaskInfo -TaskName "OpenClaw AutoStart" | Format-List *
Paste the full output here.
LastRunTime : 5/17/2026 6:58:50 PM
LastTaskResult : 0
NextRunTime :
NumberOfMissedRuns : 0
TaskName : OpenClaw AutoStart
TaskPath :
PSComputerName :
CimClass : Root/Microsoft/Windows/TaskScheduler:MSFT_TaskDynamicInfo
CimInstanceProperties : {LastRunTime, LastTaskResult, NextRunTime, NumberOfMissedRuns...}
CimSystemProperties : Microsoft.Management.Infrastructure.CimSystemProperties```
Task Scheduler thinks it succeeded, so the VBS ran. The likely issue is that ~/start-openclaw.sh exits quickly or fails silently.
Step 28: run the same command visibly
In PowerShell, run only this:
wsl.exe -d Ubuntu-24.04-D bash -lc "~/start-openclaw.sh; sleep 5; /home/wrakeeb/.npm-global/bin/openclaw gateway status"
Paste the full output here.
Failed to attach disk 'D:\WSL\Ubuntu-24.04\ext4.vhdx' to WSL2: The process cannot access the file because it is being used by another process.
Error code: Wsl/Service/CreateInstance/MountDisk/HCS/ERROR_SHARING_VIOLATION
PS C:\WINDOWS\system32>```
The scheduled task likely left a hidden launcher process holding the VHDX lock. We’ll confirm before killing anything.
Step 29: look for hidden launcher processes
In PowerShell, run only this:
Get-Process wscript,wsl,wslhost -ErrorAction SilentlyContinue | Select-Object Id,ProcessName,StartTime,Path | Format-Table -AutoSize
Paste the full output here.
no output
No launcher process is visible, so this is probably the WSL service/kernel holding the VHDX lock internally. At this point the clean fix is a reboot, and we already updated the autostart script before this happened.
Step 30: reboot and test autostart
Restart Windows normally.
After logging back in, wait about 60 seconds, then open PowerShell and run only this:
wsl --list --verbose
Paste the output here. If the autostart worked, we should see Ubuntu-24.04-D running, not the old Ubuntu-24.04.
the fuck are we doing right now? Is this all for task sceduler?
Yeah, fair frustration. The move itself is already done. The only thing we’re fighting now is Task Scheduler/autostart.
Current state:
- Your Ubuntu data was exported safely.
- The new WSL distro on D: exists as
Ubuntu-24.04-D. - OpenClaw runs in it.
- The gateway was verified working in it.
- The old C: distro still exists untouched as a fallback.
- The Task Scheduler script was changed to target
Ubuntu-24.04-D.
What’s left is only: does autostart work after reboot? If you don’t care about Task Scheduler right now, we can stop here and you can start the D: copy manually with:
wsl -d Ubuntu-24.04-D
I would not delete the old Ubuntu-24.04 today. Keep it for a few days. The safe stopping point is: migration done, old copy retained, autostart mostly configured but not final-tested because WSL keeps locking the VHDX.
Ahhh. What now?
Now I’d do the smallest final check and then stop.
Step 31: final reboot test
Restart Windows normally. After login, wait 60 seconds, then run:
wsl --list --verbose
Paste that output.
What we’re looking for:
- Best case:
Ubuntu-24.04-Dis Running. Autostart works. - Still okay: both are Stopped. The move is still done; autostart just needs separate cleanup later.
- Bad case: old
Ubuntu-24.04is Running. Then something else is still launching the old copy.
After that, I’d stop. Do not delete the old C: distro yet. Keep it as rollback for a few days.
so, what to do now?
Do this now:
- Restart Windows normally.
- Log back in.
- Wait 60 seconds.
- Open PowerShell and run:
wsl --list --verbose
Paste that output here.
That single check tells us whether the updated Task Scheduler autostart is using the D: copy. After that, we either call it done or fix only the autostart. The actual WSL move is already done.
After restart:
PS C:\WINDOWS\system32> wsl --list --verbose
NAME STATE VERSION
- Ubuntu-24.04 Stopped 2
Ubuntu-24.04-D Running 2
Excellent. That’s the result we wanted:
- Old C: distro:
Ubuntu-24.04= stopped - New D: distro:
Ubuntu-24.04-D= running - Task Scheduler/autostart is now using the D: copy
One small cleanup remains: the * still marks the old C: distro as the default. Let’s switch the default so plain wsl opens the D: copy.
Final Step: set D: copy as default
In PowerShell, run:
wsl --set-default Ubuntu-24.04-D
wsl --list --verbose
Paste the output. Do not unregister/delete the old Ubuntu-24.04 yet. Keep it as rollback for a few days.
PS C:\WINDOWS\system32> wsl --set-default Ubuntu-24.04-D
wsl --list --verbose
The operation completed successfully.
NAME STATE VERSION
- Ubuntu-24.04-D Running 2
Ubuntu-24.04 Stopped 2
Done. That is the clean final state:
Ubuntu-24.04-Dis now the default WSL distro- It is running from D:
- The old
Ubuntu-24.04on C: is stopped - Task Scheduler autostart is pointing at the D: distro
For now, do not delete/unregister the old Ubuntu-24.04 and don’t delete D:\WSL\Backups\Ubuntu-24.04-backup.tar. Keep both for a few days as rollback.
When you’re fully confident later, the old distro can be removed with wsl --unregister Ubuntu-24.04, but don’t run that today.
Glad we got through the messy lock stuff. If this solved it, please right-click the solution message → Apps → ✅ Mark Solution so Answer Overflow indexes it for future users.
How can we confirm that the OpenClaw and ubuntu now running on D drive?
Yes. Confirm it from Windows with the WSL registry path.
Run this in PowerShell:
Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss |
ForEach-Object {
$p = Get-ItemProperty $_.PsPath
[PSCustomObject]@{
Name = $p.DistributionName
BasePath = $p.BasePath
DefaultUid = $p.DefaultUid
}
} | Format-Table -AutoSize
You want to see:
Ubuntu-24.04-DhasBasePathunderD:\WSL\Ubuntu-24.04- old
Ubuntu-24.04has a different path, likely under C:
Then confirm OpenClaw is the one running inside the D distro:
wsl --list --verbose
wsl -d Ubuntu-24.04-D -- /home/wrakeeb/.npm-global/bin/openclaw gateway status
If that shows Ubuntu-24.04-D Running and gateway probe OK/listening, then Ubuntu + OpenClaw are running from the D: distro.
>> wsl -d Ubuntu-24.04-D -- /home/wrakeeb/.npm-global/bin/openclaw gateway status
NAME STATE VERSION
* Ubuntu-24.04-D Running 2
Ubuntu-24.04 Stopped 2
🦞 OpenClaw 2026.5.4 (325df3e) — I speak fluent bash, mild sarcasm, and aggressive tab-completion energy.
│
â—‡
Service: systemd user (enabled)
File logs: /tmp/openclaw/openclaw-2026-05-17.log
Command: /usr/bin/node /home/wrakeeb/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 496, state active, sub running, last exit 0, reason 0)
Connectivity probe: ok
Capability: admin-capable
Listening: 127.0.0.1:18789
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting```
That confirms OpenClaw is running in Ubuntu-24.04-D and the gateway is healthy:
Ubuntu-24.04-Dis the default and Running- old
Ubuntu-24.04is Stopped - OpenClaw gateway probe is ok
- gateway is listening on
127.0.0.1:18789
One last optional proof of the actual disk path is the registry BasePath check I sent before. If Ubuntu-24.04-D shows D:\WSL\Ubuntu-24.04, that proves the distro storage is on D:.
You’re done operationally. Keep the old distro and backup tar for a few days before deleting anything.
Alright. Now how can i open the disk of Ubuntu?
There are two different “disks” here:
To open your Ubuntu files normally
In File Explorer, type this in the address bar:
\\wsl.localhost\Ubuntu-24.04-D\home\wrakeeb
Or from PowerShell:
explorer.exe "\\wsl.localhost\Ubuntu-24.04-D\home\wrakeeb"
That opens your Ubuntu home folder safely.
To see where the actual WSL disk file lives
It should be here:
D:\WSL\Ubuntu-24.04\ext4.vhdx
Don’t open/edit ext4.vhdx directly while WSL is running. Treat that as the virtual disk container. Use \\wsl.localhost\Ubuntu-24.04-D\... for normal file access.
Alright. Im not that expericed so I don't know what happened. But everything is fine right? Anything need to check?
Yes, based on the checks you pasted, everything important is fine.
What happened in plain English:
- We copied your Ubuntu WSL system from C: to D:
- The new copy is named
Ubuntu-24.04-D - We made it the default Ubuntu
- OpenClaw is running inside that D: copy
- The OpenClaw gateway check passed:
Connectivity probe: ok - The old C: copy is still there but stopped, so you have a backup/rollback
Nothing else urgent to check right now.
For peace of mind, these are the only two checks I’d run tomorrow after a normal restart:
wsl --list --verbose
wsl -d Ubuntu-24.04-D -- /home/wrakeeb/.npm-global/bin/openclaw gateway status
Good result:
Ubuntu-24.04-Dis runningUbuntu-24.04is stopped- OpenClaw says
Connectivity probe: ok
Keep the old Ubuntu-24.04 and D:\WSL\Backups\Ubuntu-24.04-backup.tar for a few days. Don’t delete them yet.
now do I need to run anything?
No, nothing else right now.
You can stop here.
Only run these tomorrow after a normal restart, just to confirm everything stayed good:
wsl --list --verbose
wsl -d Ubuntu-24.04-D -- /home/wrakeeb/.npm-global/bin/openclaw gateway status
For now: don’t delete the old Ubuntu-24.04 distro or the backup tar. That’s your rollback.
can I run it now?
Yes, you can run it now if you want. It’s just a check, it won’t change anything.
Run:
wsl --list --verbose
wsl -d Ubuntu-24.04-D -- /home/wrakeeb/.npm-global/bin/openclaw gateway status
Expected good result:
Ubuntu-24.04-DisRunningUbuntu-24.04isStopped- gateway status says
Connectivity probe: ok
PS C:\WINDOWS\system32> wsl --list --verbose
>> wsl -d Ubuntu-24.04-D -- /home/wrakeeb/.npm-global/bin/openclaw gateway status
NAME STATE VERSION
* Ubuntu-24.04-D Running 2
Ubuntu-24.04 Stopped 2
🦞 OpenClaw 2026.5.4 (325df3e) — I don't sleep, I just enter low-power mode and dream of clean diffs.
│
â—‡
Service: systemd user (enabled)
File logs: /tmp/openclaw/openclaw-2026-05-17.log
Command: /usr/bin/node /home/wrakeeb/.npm-global/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789
Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json
Gateway: bind=loopback (127.0.0.1), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://127.0.0.1:18789/
Probe note: Loopback-only gateway; only local clients can connect.
Runtime: running (pid 496, state active, sub running, last exit 0, reason 0)
Connectivity probe: ok
Capability: admin-capable
Listening: 127.0.0.1:18789
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting
Yep, that’s fully good.
Ubuntu-24.04-Dis default and running- old
Ubuntu-24.04is stopped - OpenClaw gateway is running
Connectivity probe: ok- listening on
127.0.0.1:18789
You don’t need to run anything else now. Just keep the old distro and the backup tar for a few days as rollback, then remove them later only after you’re confident everything still works.
THe old distro is in C drive still?
Most likely yes. The old Ubuntu-24.04 is still registered and stopped, and because it was your original install, it’s probably still stored on C:.
To confirm exactly, run this in PowerShell:
Get-ChildItem HKCU:\Software\Microsoft\Windows\CurrentVersion\Lxss |
ForEach-Object {
$p = Get-ItemProperty $_.PsPath
[PSCustomObject]@{
Name = $p.DistributionName
BasePath = $p.BasePath
}
} | Format-Table -AutoSize
Look at BasePath:
Ubuntu-24.04-Dshould point toD:\WSL\Ubuntu-24.04Ubuntu-24.04probably points somewhere underC:\Users\...
Don’t remove the old one yet. It’s your rollback copy.
>> ForEach-Object {
>> $p = Get-ItemProperty $_.PsPath
>> [PSCustomObject]@{
>> Name = $p.DistributionName
>> BasePath = $p.BasePath
>> }
>> } | Format-Table -AutoSize
Name BasePath
---- --------
Ubuntu-24.04 C:\Users\rakib\AppData\Local\wsl\{622de361-176f-4359-acdd-a4edd2f2173e}
Ubuntu-24.04-D D:\WSL\Ubuntu-24.04
Confirmed:
- old
Ubuntu-24.04is still on C:
C:\Users\rakib\AppData\Local\wsl\{622de361-176f-4359-acdd-a4edd2f2173e} - new
Ubuntu-24.04-Dis on D:
D:\WSL\Ubuntu-24.04
So yes, the old distro is still taking C: space. Keep it for a few days as rollback. Later, when you’re 100% sure everything works, the command to remove the old C: distro is:
wsl --unregister Ubuntu-24.04
But don’t run that today.
Itll delete if I run this?
Yes. wsl --unregister Ubuntu-24.04 deletes that old C: distro and its Linux filesystem. It is not a normal “remove from list” command; it removes the distro data.
So don’t run it unless:
Ubuntu-24.04-Dhas worked for a few days- OpenClaw still starts after reboot
- you no longer need anything from the old C: copy
- you still have the backup tar at
D:\WSL\Backups\Ubuntu-24.04-backup.tar
Right now I recommend: do not run it today.
Alright thank you.
Summurize the chats and make a compact list with all the important details and solutions. Make a minimal list
Summary:
- Goal: move WSL Ubuntu + OpenClaw from C: to D: without breaking setup.
- Original distro:
Ubuntu-24.04 - New D: distro:
Ubuntu-24.04-D - Backup created:
D:\WSL\Backups\Ubuntu-24.04-backup.tar - New distro location:
D:\WSL\Ubuntu-24.04 - Old distro location:
C:\Users\rakib\AppData\Local\wsl\{622de361-176f-4359-acdd-a4edd2f2173e} - Final WSL state:
Ubuntu-24.04-Dis default + running; oldUbuntu-24.04is stopped. - OpenClaw verified in D: distro:
OpenClaw 2026.5.4 (325df3e) - OpenClaw gateway verified:
Connectivity probe: ok, listening on127.0.0.1:18789 - Task Scheduler script updated:
C:\Users\rakib\start-openclaw-hidden.vbsnow launchesUbuntu-24.04-D - Safe file access path:
\\wsl.localhost\Ubuntu-24.04-D\home\wrakeeb - Do not edit/open directly while running:
D:\WSL\Ubuntu-24.04\ext4.vhdx - Important: do not run
wsl --unregister Ubuntu-24.04yet; it deletes the old C: distro. - Keep old
Ubuntu-24.04and backup tar for a few days as rollback.
More details would be helpful
Detailed summary:
What we moved
- Original WSL distro was
Ubuntu-24.04. - It was stored on C: at:
C:\Users\rakib\AppData\Local\wsl\{622de361-176f-4359-acdd-a4edd2f2173e} - We exported it to:
D:\WSL\Backups\Ubuntu-24.04-backup.tar - We imported that backup as a new distro:
Ubuntu-24.04-D - New distro storage is:
D:\WSL\Ubuntu-24.04
Final state
Ubuntu-24.04-Dis now the default WSL distro.Ubuntu-24.04-Dis running.- Old
Ubuntu-24.04is stopped and still available as rollback.
- OpenClaw is running inside
Ubuntu-24.04-D.
OpenClaw verification
- Version checked:
OpenClaw 2026.5.4 (325df3e) - Gateway status checked successfully.
- Good result shown:
Connectivity probe: ok - Gateway is listening on:
127.0.0.1:18789 - Dashboard URL:
http://127.0.0.1:18789/
Autostart / Task Scheduler
- Task name:
OpenClaw AutoStart - It runs:
C:\Users\rakib\start-openclaw-hidden.vbs
- We backed it up as:
C:\Users\rakib\start-openclaw-hidden.vbs.bak - We changed the VBS so it launches:
wsl.exe -d Ubuntu-24.04-D bash -lc "~/start-openclaw.sh" - After reboot, Task Scheduler successfully started
Ubuntu-24.04-D.
Important problem encountered
- WSL sometimes locked:
D:\WSL\Ubuntu-24.04\ext4.vhdx - Error was:
ERROR_SHARING_VIOLATION - Fix/workaround:
restart WSL service or reboot Windows. - Final reboot test passed.
How to open Ubuntu files
- Safe File Explorer path:
\\wsl.localhost\Ubuntu-24.04-D\home\wrakeeb - Actual virtual disk file:
D:\WSL\Ubuntu-24.04\ext4.vhdx - Do not open/edit
ext4.vhdxdirectly while WSL is running.
What not to do yet
- Do not run:
wsl --unregister Ubuntu-24.04 - That deletes the old C: distro’s filesystem.
- Keep old
Ubuntu-24.04andD:\WSL\Backups\Ubuntu-24.04-backup.tarfor a few days.
Future cleanup, only after everything works for a few days
- Remove old C: distro:
wsl --unregister Ubuntu-24.04 - Only do this after confirming
Ubuntu-24.04-Dand OpenClaw still work after multiple restarts.
Ty
Anytime. Glad we got it moved safely.
If this thread solved it, please right-click the solution message → Apps → ✅ Mark Solution. That helps Answer Overflow index the steps for future users.