Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
4 tasks done
mabdelfattah opened this issue Aug 7, 2019 · 26 comments
Open
4 tasks done

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

mabdelfattah opened this issue Aug 7, 2019 · 26 comments
Labels
Bug This is a problem. Insider This issue affects Windows 10 Insider builds. Upstream Issue This is an issue with an upstream package.

Comments

@mabdelfattah
Copy link

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 sirredbeard added the Triage We need to figure out what is going on here. label Aug 7, 2019
@sirredbeard
Copy link

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
Copy link
Author

mabdelfattah commented Aug 7, 2019

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
Copy link

Biswa96 commented Aug 7, 2019

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?

@wkrea
Copy link

wkrea commented Aug 8, 2019

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
Copy link

wkrea commented Aug 9, 2019

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 sirredbeard added the Insider This issue affects Windows 10 Insider builds. label Aug 9, 2019
@sirredbeard
Copy link

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 sirredbeard added the Upstream Issue This is an issue with an upstream package. label Aug 9, 2019
@mabdelfattah
Copy link
Author

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

@sirredbeard
Copy link

I have submitted the issue upstream to the WSL team here microsoft/WSL#4394.

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

@Biswa96
Copy link

Biswa96 commented Aug 12, 2019

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

@sirredbeard
Copy link

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

@mabdelfattah
Copy link
Author

mabdelfattah commented Aug 18, 2019

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

@sirredbeard
Copy link

@mabdelfattah

Are you running on a build 18945 or higher? #497

@sirredbeard sirredbeard added Bug This is a problem. and removed Triage We need to figure out what is going on here. labels Aug 19, 2019
@mabdelfattah
Copy link
Author

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

@PSzczepanski1996
Copy link

PSzczepanski1996 commented Aug 30, 2019

image

Same here...

@sirredbeard
Copy link

@HoshiYamazaki Please subscribe to microsoft/WSL#4394 for more details on this.

@rsk25
Copy link

rsk25 commented Sep 6, 2019

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
Copy link

@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
Copy link

Dvbnhbq commented Jan 10, 2020

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

@twocs
Copy link

twocs commented Mar 31, 2020

@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
Copy link

Mehdi13k8 commented Jun 17, 2020

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
Copy link

@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
Copy link
Collaborator

Hello,

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

Regards

@OheneAsare
Copy link

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
Copy link
Collaborator

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
Copy link

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.

microsoft/WSL#4102 (comment)

@crramirez
Copy link
Collaborator

@CompSciMaj13 Thanks for sharing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug This is a problem. Insider This issue affects Windows 10 Insider builds. Upstream Issue This is an issue with an upstream package.
Projects
None yet
Development

No branches or pull requests