Pengwin icon indicating copy to clipboard operation
Pengwin copied to clipboard

Cant upgrade to WSL2 "bsdtar: Write error"

Open mabdelfattah opened this issue 6 years ago • 26 comments

Describe the bug

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

Basic Troubleshooting Checklist

  • [x] I have searched Google for the error message.
  • [x] I have checked official WSL troubleshooting documentation: https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#confirm-wsl-is-enabled.
  • [x] I have searched the official Microsoft WSL issues page: https://github.com/Microsoft/WSL/issues.
  • [x] I have searched the Pengwin issues page: https://github.com/WhitewaterFoundry/Pengwin/issues. [ ] I have reset Pengwin: Settings->Apps->Apps & features->Pengwin->Advanced Options->Reset. [ ] I have disabled and re-enabled WSL in Windows Features. [x] I have run Windows 10 updates and restarted.

*What other troubleshooting have you attempted? Made sure that WSL is not running, restarted multiple times and kept re-trying but failed.

Pengwin Version 1.2.7.0

Windows Build 10.0.18947 N/A Build 18947

mabdelfattah avatar Aug 07 '19 14:08 mabdelfattah

I have seen this too.

I found that resetting back to factory Pengwin, reducing the size of the installed application helps.

I wonder if this is a bug in the conversion process that affects installs over a certain size.

More investigation is needed and possible upstream bug report.

sirredbeard avatar Aug 07 '19 14:08 sirredbeard

I found that resetting back to factory Pengwin, reducing the size of the installed application helps.

But resting back to factory Pengwin, will remove all installed apps, right? If so, I don't think this is an easy step for me now :) !

I wonder if this is a bug in the conversion process that affects installs over a certain size.

How can I get you my installation size?

mabdelfattah avatar Aug 07 '19 14:08 mabdelfattah

Some questions:

  • Did you see too much memory usage during conversion?
  • Is the size of rootfs folder greater than 3-4 GB?
  • Did you try to convert other distribution 1) form Windows store 2) from manually installed/imported?

Biswa96 avatar Aug 07 '19 17:08 Biswa96

Hi @Biswa96

What do you think?

bug

I just manually install Ubuntu 18.04

bug1

Windows Build

10.Pro N Build 18956.rs_prerelease 190803-1414

wkrea avatar Aug 08 '19 23:08 wkrea

Hi @mabdelfattah @Biswa96

Ok, now it's works like a Charm!!!

It's a messy procedure an d i donk know, but some tips from this post did the magic.

  1. I disable all options from Windows security system
  2. Install Arch WSL like this post
  3. So, I decide reinstall my ubuntu manually, Again!!!
  4. Final, only carry on two distros (Arch and Ubuntu), to WSL 2, as you can see in this picture bug3 ]()

Now, anyone can explain what is the charm?

wkrea avatar Aug 09 '19 00:08 wkrea

The fact we can reproduce this issue across multiple distros leads me to think it is an upstream issue.

Has anyone reported this upstream or something similar?

sirredbeard avatar Aug 09 '19 05:08 sirredbeard

@sirredbeard any idea where can we "report this upstream"?

mabdelfattah avatar Aug 09 '19 06:08 mabdelfattah

I have submitted the issue upstream to the WSL team here https://github.com/microsoft/WSL/issues/4394.

Lets try to land a hand there tracking this down as it affects all distros.

sirredbeard avatar Aug 09 '19 13:08 sirredbeard

Has anyone got strace -ff output or event trace logs as provided here?

Biswa96 avatar Aug 12 '19 14:08 Biswa96

@Biswa96 I was actually working on that last night for this issue and got distracted. Trying to make it consistently fail. Stand by.

sirredbeard avatar Aug 12 '19 17:08 sirredbeard

I have just disabled Windows Security, re-tried and the command completed successfully this time but neither bash.exe nor Pengwin app work :(

mabdelfattah avatar Aug 18 '19 14:08 mabdelfattah

@mabdelfattah

Are you running on a build 18945 or higher? https://github.com/WhitewaterFoundry/Pengwin/issues/497

sirredbeard avatar Aug 19 '19 18:08 sirredbeard

I'm running 18963, and it is working now (with some weird lagging) after I edited 00-pengwin.sh

mabdelfattah avatar Aug 20 '19 04:08 mabdelfattah

image

Same here...

memegauste avatar Aug 30 '19 20:08 memegauste

@HoshiYamazaki Please subscribe to https://github.com/microsoft/WSL/issues/4394 for more details on this.

sirredbeard avatar Aug 30 '19 20:08 sirredbeard

I had the same error, too. Since the error was related to 'bsdtar', my intuition was to do the following

  1. open linux distro
  2. sudo apt-get update
  3. sudo apt-get install libarchive-tools I'm a linux novice, so I don't really know what 'libarchive-tools' does exactly, but it was the first thing that popped-up when I googled 'bsdtar'.

Currently, I'm running wsl2 without a problem (for now)

rsk25 avatar Sep 06 '19 07:09 rsk25

@KaraxThePhaseSmith That's interesting. I don't think it's calling bsdtar in the distro, I think it's calling a bsdtar binary in the WSL layer. It might have worked then because this bug is sporadic at times. But I will pass it along.

sirredbeard avatar Sep 09 '19 17:09 sirredbeard

For those who is interested, disabling real-time protection of Windows Defender did the thing for me. Disgusting!

Dvbnhbq avatar Jan 10 '20 18:01 Dvbnhbq

@KaraxThePhaseSmith That's interesting. I don't think it's calling bsdtar in the distro, I think it's calling a bsdtar binary in the WSL layer. It might have worked then because this bug is sporadic at times. But I will pass it along.

It worked for me.

In Windows:

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.
bsdtar: Write error

open linux distro (Ubuntu)

sudo apt-get update
sudo apt-get install libarchive-tools
close linux distro

In Windows (didn't even close Powershell in between):

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.

twocs avatar Mar 31 '20 07:03 twocs

Hi Ryzen 5 3600X 4.10ghz 16 GB* DDR3 Win 10 edu on build 19042.330 (20h2)

the only fix that worked for me was to limit the ram usage etc...

[wsl2] memory=3GB swap=0 localhostForwarding=true

sirredbeard was maybe in the right when he said it could be "random" bugs, I still had plenty of ram free like 60%, but yet it crashed when I limited it, ram allocation was stuck to 3064~72 MB and it was successfull on first call.

(I tried every tips on this page and my wsl install is fresh)


edit : I did a fresh install (same pc) and the bug didn't repeat (2004), I guess it happen when we do weird stuff on our pc ?

Mehdi13k8 avatar Jun 17 '20 22:06 Mehdi13k8

@KaraxThePhaseSmith That's interesting. I don't think it's calling bsdtar in the distro, I think it's calling a bsdtar binary in the WSL layer. It might have worked then because this bug is sporadic at times. But I will pass it along.

It worked for me.

In Windows:

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.
bsdtar: Write error

open linux distro (Ubuntu)

sudo apt-get update
sudo apt-get install libarchive-tools
close linux distro

In Windows (didn't even close Powershell in between):

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.

I had a brokenpipe error when crackmapexec was being installed how can i fix that

OheneAsare avatar Aug 10 '20 01:08 OheneAsare

Hello,

I don't thing this is the same error. Could you elaborate more what you did and the result?

Regards

crramirez avatar Aug 10 '20 06:08 crramirez

Yes yes ... It's not an error when trying to upgrade to wsl-2 This happens when I try to install libarchive tools(sudo apt-get install libarchive-tools) which is part of the solution you gave

OheneAsare avatar Aug 10 '20 07:08 OheneAsare

The most probable issue is due to a problem in internet connection. I tried now to install this package and it installed without problems. Try to issue an apt update and try again.

crramirez avatar Aug 10 '20 08:08 crramirez

I ran into quite a few issues when converting from WSL 1 to WSL 2 that relates to this ticket. I detailed my environment and the journey I took to work around them in the following comment.

https://github.com/microsoft/WSL/issues/4102#issuecomment-673145649

CompSciMaj13 avatar Aug 12 '20 22:08 CompSciMaj13

@CompSciMaj13 Thanks for sharing

crramirez avatar Aug 13 '20 07:08 crramirez