Unusual Behavior Converting Distro To WSL2 18947+
- Your Windows build number: (Type
verat a Windows Command Prompt)
18947-18956
- What you're doing and what's happening:
PS C:\Users\username> wsl --set-version WLinux 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Exporting the distribution failed.
bsdtar: Write error

- What's wrong / what should be happening instead:
Conversion of distros to WSL2 is failing with a bsdtar error under mysterious circumstances.
This appears to affect all distros, including Pengwin and Ubuntu.
We began tracking this issue here https://github.com/WhitewaterFoundry/Pengwin/issues/504.
After duplication with other distros are reporting upstream while we continue to investigate.
Reducing the size of the installed distro by resetting it to original image seems to help.
I had the same issue, bsdtar: Write error. I reran the conversion and it succeeded the second time around.
wsl --set-version Ubuntu-18.04
wsl --list --verbose shows that it is now running as Version 2. I ran bash and confirmed that everything was still there and that it was indeed version 2.
I see the same behavior as @egroenen converting distros so far. Note I did disable realtime virus and thread protection between my attempt so that also could have been a factor.
PS C:\WINDOWS\system32> wsl --set-version WLinux 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Exporting the distribution failed.
bsdtar: Write error
PS C:\WINDOWS\system32> wsl --set-version WLinux 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion complete.
PS C:\WINDOWS\system32>
Can confirm I experienced the same issue as others. @ltomes, doesn't seem like AV/thread protection plays a role here. Simply re-running the conversion seems to work:
wsl --set-version Ubuntu 2 Conversion in progress, this may take a few minutes... For information on key differences with WSL 2 please visit https://aka.ms/wsl2 Exporting the distribution failed. bsdtar: Write error
wsl --set-version Ubuntu 2 Conversion in progress, this may take a few minutes... For information on key differences with WSL 2 please visit https://aka.ms/wsl2 Conversion complete.
wsl --list --verbose NAME STATE VERSION Ubuntu Stopped 2 Legacy Stopped 1`
Interesting, looks like there still may be some issues with conversion. I will take a look.
In case it helps someone: I had this error after a different error. I resolved the first error using this method: https://github.com/microsoft/WSL/issues/4103#issuecomment-501885534
After that, I got the error here (bsdtar) no matter how many times I ran --set-version.
Following a reboot, the conversion process succeeded. I'm not sure whether just restarting Powershell would have done the trick (Update: it wouldn't have, I tried the next time and it required a full reboot of the computer).
@eblount What distribution are you using? I am in the exact same situation but after fixing the #4103 issue, I always get a bsdtar: Write error even after reboot. Trying to export a fresh Ubuntu 18.04 install.
@jerrodrs Yeah, I'm using Ubuntu 18.04. I installed it fresh because I had an older Ubuntu from WSL1, and I needed 18.04 for the Docker WSL2 preview. Sorry about the troubles, it was a headache getting past all these little issues, but I'll confirm that it's worth it once you get there - Docker on Windows has never been faster, and the whole Ubuntu experience has been great on WSL2. I guess make sure you're upgrading the correct distro by name, if you have multiple, and failing that, maybe uninstall all the distros and start over?
@jerrodrs Oh, also, make sure you have enough disk space. My hunch is that this conversion process requires a good deal of it.
Disabling Windows Real Time protection did the trick!
Same here, but it's fixed after I free up disk space.
PS C:\WINDOWS\system32> wsl --set-version Ubuntu 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Exporting the distribution failed.
: Write error
Make sure you have enough disk space.
PS C:\WINDOWS\system32> wsl --set-version Ubuntu 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion complete.
PS C:\WINDOWS\system32> wsl --list --verbose
NAME STATE VERSION
* Ubuntu Stopped 2
PS C:\WINDOWS\system32>
Did anyone update to latest Windows insider build 18970? I've tested, this issue is fixed in that build.
@Biswa96
@benhillis will probably have to tell us.
I think there is a chance the fix for you was incidental. Two reasons: 1. This bug is not listed as fixed in the release notes or marked as such and they are pretty good at doing that, but maybe it was fixed. 2. I have also gotten at least one report of this bug on 18970, though that could have been unrelated.
For what it's worth, as a workaround I did wsl --export and wsl --import so I got a copy of my original Linux running on wsl2. Now just to figure out how to set the user for my wsl2 instance (it starts as root) and will be perfect.
Running: Microsoft Windows [Version 10.0.18970.1005]
I got this issue:
PS C:\WINDOWS\system32> wsl --set-version Ubuntu-18.04 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Exporting the distribution failed.
bsdtar: Write error
PS C:\WINDOWS\system32> wsl --set-version Ubuntu-18.04 2
Conversion in progress, this may take a few minutes...
For information on key differences with WSL 2 please visit https://aka.ms/wsl2
Conversion complete.
PS C:\WINDOWS\system32> wsl -l --verbose
NAME STATE VERSION
* Ubuntu-18.04 Stopped 2
As you can see, seemingly with no change in-between it suddenly worked the second time around...
Is this error occurs with distros installed from Windows Store? Anyone tried to manually install a distro in Desktop or Documents folder?
I installed from the store
One more data point on build 18970 on a fresh computer, first attempt failed, second attempt worked, no changes made in between attempts.
For the record, for me, it worked after turning off AV protection (Windows Defender). May have just been luck, but it failed multiple times before I did so and I noticed Defender activity the last time it failed.
Thanks, @greggmarshall and @zachl123. I think a tough issue with this bug is reproducibility.
Adding bsdtar to the list of excluded processes in virus protection also worked.