WhitewaterFoundry / Pengwin

A Linux distro optimized for WSL based on Debian.
Other
1.47k stars 104 forks source link

Cant upgrade to WSL2 "bsdtar: Write error" #504

Open mabdelfattah opened 4 years ago

mabdelfattah commented 4 years ago

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

*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

sirredbeard commented 4 years ago

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.

mabdelfattah commented 4 years ago

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?

Biswa96 commented 4 years ago

Some questions:

wkrea commented 4 years ago

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 commented 4 years ago

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?

sirredbeard commented 4 years ago

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?

mabdelfattah commented 4 years ago

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

sirredbeard commented 4 years ago

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.

Biswa96 commented 4 years ago

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

sirredbeard commented 4 years ago

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

mabdelfattah commented 4 years ago

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

sirredbeard commented 4 years ago

@mabdelfattah

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

mabdelfattah commented 4 years ago

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

PSzczepanski1996 commented 4 years ago

image

Same here...

sirredbeard commented 4 years ago

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

rsk25 commented 4 years ago

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)

sirredbeard commented 4 years ago

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

Dvbnhbq commented 4 years ago

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

twocs commented 4 years ago

@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.
Mehdi13k8 commented 4 years ago

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 ?

OheneAsare commented 3 years ago

@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

crramirez commented 3 years ago

Hello,

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

Regards

OheneAsare commented 3 years ago

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

crramirez commented 3 years ago

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.

CompSciMaj13 commented 3 years ago

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

crramirez commented 3 years ago

@CompSciMaj13 Thanks for sharing