WSL icon indicating copy to clipboard operation
WSL copied to clipboard

Unusual Behavior Converting Distro To WSL2 18947+

Open sirredbeard opened this issue 7 years ago • 30 comments

  • Your Windows build number: (Type ver at 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

62743620-ad35ce00-ba08-11e9-9e7b-b83182002d1a

  • 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.

sirredbeard avatar Aug 09 '19 13:08 sirredbeard

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.

egroenen avatar Aug 11 '19 08:08 egroenen

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>

ltomes avatar Aug 12 '19 14:08 ltomes

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`

craigdods avatar Aug 13 '19 13:08 craigdods

Interesting, looks like there still may be some issues with conversion. I will take a look.

benhillis avatar Aug 13 '19 17:08 benhillis

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 avatar Aug 15 '19 17:08 eblount

@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 avatar Aug 19 '19 23:08 jerrodrs

@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?

eblount avatar Aug 20 '19 01:08 eblount

@jerrodrs Oh, also, make sure you have enough disk space. My hunch is that this conversion process requires a good deal of it.

eblount avatar Aug 20 '19 01:08 eblount

Disabling Windows Real Time protection did the trick!

jfelixoptimiumnc avatar Aug 27 '19 05:08 jfelixoptimiumnc

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>

yuhcaesar avatar Sep 01 '19 16:09 yuhcaesar

Did anyone update to latest Windows insider build 18970? I've tested, this issue is fixed in that build.

Biswa96 avatar Sep 01 '19 16:09 Biswa96

@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.

sirredbeard avatar Sep 02 '19 15:09 sirredbeard

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.

chutzimir avatar Sep 06 '19 04:09 chutzimir

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...

MikaelUmaN avatar Sep 08 '19 20:09 MikaelUmaN

Is this error occurs with distros installed from Windows Store? Anyone tried to manually install a distro in Desktop or Documents folder?

Biswa96 avatar Sep 08 '19 21:09 Biswa96

I installed from the store

MikaelUmaN avatar Sep 09 '19 04:09 MikaelUmaN

One more data point on build 18970 on a fresh computer, first attempt failed, second attempt worked, no changes made in between attempts.

greggmarshall avatar Sep 09 '19 12:09 greggmarshall

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.

zachl123 avatar Sep 09 '19 21:09 zachl123

Thanks, @greggmarshall and @zachl123. I think a tough issue with this bug is reproducibility.

sirredbeard avatar Sep 09 '19 23:09 sirredbeard

Adding bsdtar to the list of excluded processes in virus protection also worked.

griest024 avatar Sep 12 '19 00:09 griest024