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

WSL Export Failure. Error code: Wsl/Service/WSL_E_EXPORT_FAILED #9382

Closed
1 of 2 tasks
gyutaepark opened this issue Dec 21, 2022 · 23 comments
Closed
1 of 2 tasks

WSL Export Failure. Error code: Wsl/Service/WSL_E_EXPORT_FAILED #9382

gyutaepark opened this issue Dec 21, 2022 · 23 comments

Comments

@gyutaepark
Copy link

Version

Microsoft Windows [Version 10.0.22621.963]

WSL Version

  • WSL 2
  • WSL 1

Kernel Version

5.15.79.1

Distro Version

Ubuntu 22.04

Other Software

No response

Repro Steps

wsl --shutdown
wsl --export Ubuntu D:\Extra\wsl\20221220

Expected Behavior

WSL Exports a backup of itself into 20221220 file.

Actual Behavior

Export fails within 10s of seconds.
Output file is created but the size does not change during this time.
Different output file names were tested including 20221220.tar and 20221220.tar.gz.

Export in progress, this may take a few minutes.
Exporting the distribution failed.
Error code: Wsl/Service/WSL_E_EXPORT_FAILED

Diagnostic Logs

No response

@kele6ra
Copy link

kele6ra commented Dec 21, 2022

I have the same error.
WSL2
Kernel Version: 5.15.79.1-microsoft-standard-WSL2+
Distro Version: Ubuntu 20.04
Maybe we have image size limit to export?

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 27, 2022

/logs

@ghost
Copy link

ghost commented Dec 27, 2022

Hello! Could you please provide more logs to help us better diagnose your issue?

To collect WSL logs, download and execute collect-wsl-logs.ps1 in an administrative powershell prompt:

Invoke-WebRequest -UseBasicParsing "https://raw.githubusercontent.com/microsoft/WSL/master/diagnostics/collect-wsl-logs.ps1" -OutFile collect-wsl-logs.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force
.\collect-wsl-logs.ps1

The scipt will output the path of the log file once done.

Once completed please upload the output files to this Github issue.

Click here for more info on logging

Thank you!

@ssratkevich
Copy link

Same issue.
Logs:
WslLogs-2022-12-28_11-00-57.zip

@kele6ra
Copy link

kele6ra commented Dec 28, 2022

Hello! Could you please provide more logs to help us better diagnose your issue?
Thank you!

Hello, I have collected logs.
Logs:
WslLogs-2022-12-28_11-10-41.zip

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 28, 2022

@ssratkevich: Based on the logs it looks like you're trying to export a WSL1 distro, this is probably a different issue. Can you create a new issue to track this ?

@kele6ra: Based on your logs it looks like the directory where the .vhdx is doesn't exist, can you confirm that the directory exists ?

@gyutaepark
Copy link
Author

Apologies for the delay.
Here are my logs.
WslLogs-2022-12-28_20-51-43.zip

@ghost ghost removed the needs-author-feedback label Dec 29, 2022
@OneBlue
Copy link
Collaborator

OneBlue commented Dec 29, 2022

Thanks @gyutaepark. Looking at the logs, It looks like something is wrong with that distro registration.

Can you share the output of: wsl.exe -l -v ?

Does installing store WSL (via wsl.exe --install) help ?

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 29, 2022

Actually, having a deeper look it looks like store WSL is installed on your machine, but somehow inbox WSL gets invoked. Can you share the output of: wsl.exe --version ?

@gyutaepark
Copy link
Author

gyutaepark commented Dec 29, 2022

Interesting. I'm not sure whats causing that.

Can you share the output of: wsl.exe -l -v ?

  NAME      STATE           VERSION
* Ubuntu    Stopped         2

Similarly,

Can you share the output of: wsl.exe --version ?

WSL version: 1.0.3.0
Kernel version: 5.15.79.1
WSLg version: 1.0.47
MSRDC version: 1.2.3575
Direct3D version: 1.606.4
DXCore version: 10.0.25131.1002-220531-1700.rs-onecore-base2-hyp
Windows version: 10.0.22621.963

Is there any additional information that might help?

Update

In case this might also help.

  • Ubuntu's Version: Ubuntu 22.04.1 LTS (GNU/Linux 5.15.79.1-microsoft-standard-WSL2 x86_64)
  • Currently Running with systemd = true on /etc/wsl.conf

@ssratkevich
Copy link

Hi.

@ssratkevich: Based on the logs it looks like you're trying to export a WSL1 distro, this is probably a different issue. Can you create a new issue to track this ?

I'm created new one yesterday.
#9408

@OneBlue
Copy link
Collaborator

OneBlue commented Dec 29, 2022

@gyutaepark: I wonder if you captured logs while the app was updating, can you try to capture logs again while wsl --export is running so I can compare the two executions ?

@gyutaepark
Copy link
Author

Of course.
Please find the Logs below:
WslLogs-2022-12-29_15-53-59.zip

I've ran the script once I've started the export process after shutting down wsl.

@ghost ghost removed the needs-author-feedback label Dec 29, 2022
@OneBlue
Copy link
Collaborator

OneBlue commented Dec 29, 2022

Ah I think that's the issue. @gyutaepark. Can you run the script first, then run wsl --export, and then stop the script ? This should capture the logs I need to root cause this

@gyutaepark
Copy link
Author

I hope this offers a better picture.

WslLogs-2022-12-29_16-04-33.zip

This time, I ran the log script -> Started the export process -> stopped the log script while the export was running.

@ghost ghost removed the needs-author-feedback label Dec 29, 2022
@OneBlue
Copy link
Collaborator

OneBlue commented Dec 29, 2022

@gyutaepark: I do see the export running in that logs, but I don't see the export error.

Sorry if my previous instructions were not clear. Can you please:

  • Start the log collection
  • Run wsl --export
  • Wait for export to finish
  • Stop the log collection

@gyutaepark
Copy link
Author

No worries. I should have just let it finish in the first place.

WslLogs-2022-12-29_17-09-07.zip

@ghost ghost removed the needs-author-feedback label Dec 29, 2022
@OneBlue
Copy link
Collaborator

OneBlue commented Dec 29, 2022

Thank you @gyutaepark.

Now I can see the actual issue:
bsdtar invoked oom-killer: gfp_mask=0x1100cca(GFP_HIGHUSER_MOVABLE

Looking at your .wslconfig, I see that the memory limit is 2GB and that swap is disabled, which is probably why bsdtar runs out of memory.

Can you try removing swap and memory from .wslconfig, then run: wsl.exe --shutdown and try exporting again ?

@gyutaepark
Copy link
Author

@OneBlue. Interesting. While I do have swap disabled for my wsl, the memory limit was set to 28 GB.

Still, removing the swap line did resolve the issue!
The export process finished successfully for me.

Thanks @OneBlue.
Should I close the issue?

@ghost ghost removed the needs-author-feedback label Dec 30, 2022
@OneBlue
Copy link
Collaborator

OneBlue commented Dec 30, 2022

Glad this worked ! Closing since the issue is resolved.

@theAkito
Copy link

theAkito commented Nov 8, 2023

For anyone finding this via a search machine...

In my case, I experienced this error, when the temporary directory was on a drive with insufficient space for the exported tarball.

@velikivelicu
Copy link

velikivelicu commented Apr 12, 2024

Hi, everybody
I get the same error, no success on creating .wslconfig file with the following contents in my %USERPROFILE% directory
[wsl2]
memory=4GB # Limits VM memory in WSL 2 to 4 GB
processors=2 # Makes the WSL 2 VM use two virtual processors

But some strange fact is that I can export if I specify --vhd option:
wsl --export Ubuntu "C:\WSL Images\Ubuntu_$(get-date -f yyyy-MM-dd).vhdx" --vhd

Any idea why is that? It worked so many times, and noting was changed...

Cheers

@vsorin83
Copy link

Hi, everybody I get the same error, no success on creating .wslconfig file with the following contents in my %USERPROFILE% directory [wsl2] memory=4GB # Limits VM memory in WSL 2 to 4 GB processors=2 # Makes the WSL 2 VM use two virtual processors

But some strange fact is that I can export if I specify --vhd option: wsl --export Ubuntu "C:\WSL Images\Ubuntu_$(get-date -f yyyy-MM-dd).vhdx" --vhd

Any idea why is that? It worked so many times, and noting was changed...

Cheers
remove <.vhdx" --vhd> and add <">

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants