WSL: [WSL1/2] Import error due to hard links

Important: Do not open GitHub issues for Windows crashes (BSODs) or security issues. Please direct all Windows crashes and security issues to secure@microsoft.com. Ideally, please configure your machine to capture minidumps, repro the issue, and send the minidump from "C:\Windows\minidump".

Please fill out the below information:

  • Your Windows build number: (Type ver at a Windows Command Prompt)

  • What you’re doing and what’s happening: (Copy&paste the full set of specific command-line steps necessary to reproduce the behavior, and their output. Include screen shots if that helps demonstrate the problem.) Version 1803 build 18970

  • What’s wrong / what should be happening instead: When loading Clearlinux rootfs.tar on WSL 1 and 2, it ends abruptly with unexpected error instead of loading the distro.

  • For WSL launch issues, please collect detailed logs. wslcl.zip

Attached are the 3 log files, and here is a sample of the error: sbin: Hard-link target ‘bin’ does not exist. usr/bin/b2sum: Hard-link target ‘usr/bin/[’ does not exist. usr/bin/base32: Hard-link target ‘usr/bin/[’ does not exist. usr/bin/base64: Hard-link target ‘usr/bin/[’ does not exist. usr/bin/basename: Hard-link target ‘usr/bin/[’ does not exist. usr/bin/basenc: Hard-link target ‘usr/bin/[’ does not exist. usr/bin/bzcat: Hard-link target ‘usr/bin/bunzip2’ does not exist. usr/bin/bzfgrep: Hard-link target ‘usr/bin/bzegrep’ does not exist.

the hard links come from the fact that Clearlinux uses coreutils in the default bundle os-core While the executables can be copied instead of the hard links, the libraries have the same setup (/lib points to /usr/lib).

I do have Clearlinux in WSL1 since the build 18305, but even if I export and import it again, it will also fail.

Thanks in advance for your help 😃

WSL Corsair

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 9
  • Comments: 18 (1 by maintainers)

Most upvoted comments

Even after uninstalling as many of the gems as I could (some were default; using --force per @Eyal51 would likely have fixed that), I was still having trouble. I ultimately just did a sudo apt uninstall ruby and rm -rf /var/lib/gems. That fixed it for me, and setting the WSL version of the Ubuntu app to 2 gave me back Ruby anyway.

I experienced the same. I did:

  • gem cleanup --dryrun and gem cleanup
  • apt remove ruby
  • rm -rf /home/$USER/gems

That did it for me: for i in $(gem list | awk {'print $1'}); do gem uninstall $i -ax --force; done

@haakoo : I got very similar errors also all in /rdoc related to Ruby.

C:\Users\kgwynn>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
Importing the distribution failed.
./usr/lib/ruby/2.5.0/rdoc/generator/template/darkfish/js/jquery.js: Hard-link target './var/lib/gems/2.5.0/doc/rubygems-update-3.1.2/rdoc/js/jquery.js' does not exist.
./usr/lib/ruby/2.5.0/rdoc/generator/template/darkfish/fonts/Lato-Light.ttf: Hard-link target './var/lib/gems/2.5.0/doc/rubygems-update-3.1.2/rdoc/fonts/Lato-Light.ttf' does not exist.
./usr/lib/ruby/2.5.0/rdoc/generator/template/darkfish/fonts/Lato-LightItalic.ttf: Hard-link target './var/lib/gems/2.5.0/doc/rubygems-update-3.1.2/rdoc/fonts/Lato-LightItalic.ttf' does not exist.
./usr/lib/ruby/2.5.0/rdoc/generator/template/darkfish/fonts/Lato-Regular.ttf: Hard-link target './var/lib/gems/2.5.0/doc/rubygems-update-3.1.2/rdoc/fonts/Lato-Regular.ttf' does not exist.
./usr/lib/ruby/2.5.0/rdoc/generator/template/darkfish/fonts/Lato-RegularItalic.ttf: Hard-link target './var/lib/gems/2.5.0/doc/rubygems-update-3.1.2/rdoc/fonts/Lato-RegularItalic.ttf' does not exist.
bsdtar: Error exit delayed from previous errors.

Logging into WSL to remove ruby manually and trying again… WORKED FOR ME

Even after uninstalling as many of the gems as I could (some were default; using --force per @Eyal51 would likely have fixed that), I was still having trouble. I ultimately just did a sudo apt uninstall ruby and rm -rf /var/lib/gems. That fixed it for me, and setting the WSL version of the Ubuntu app to 2 gave me back Ruby anyway.

ok so I had to reinstall ruby, and then tried cleaning up rdoc, power_assert, net-telnet, minitest, and fileutils. That didn’t work, so then I uninstalled them with gem uninstall.

That didn’t work either, then I noticed that the error message actually changed a bit:

./var/lib/gems/2.5.0/doc/etc-1.0.1/rdoc/js/jquery.js: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/js/jquery.js' does not exist.
./var/lib/gems/2.5.0/doc/etc-1.0.1/rdoc/fonts/Lato-Light.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-Light.ttf' does not exist.
./var/lib/gems/2.5.0/doc/etc-1.0.1/rdoc/fonts/Lato-LightItalic.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-LightItalic.ttf' does not exist.
./var/lib/gems/2.5.0/doc/etc-1.0.1/rdoc/fonts/Lato-Regular.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-Regular.ttf' does not exist.
./var/lib/gems/2.5.0/doc/etc-1.0.1/rdoc/fonts/Lato-RegularItalic.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-RegularItalic.ttf' does not exist.
./var/lib/gems/2.5.0/doc/did_you_mean-1.2.1/rdoc/js/jquery.js: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/js/jquery.js' does not exist.
./var/lib/gems/2.5.0/doc/did_you_mean-1.2.1/rdoc/fonts/Lato-Light.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-Light.ttf' does not exist.
./var/lib/gems/2.5.0/doc/did_you_mean-1.2.1/rdoc/fonts/Lato-LightItalic.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-LightItalic.ttf' does not exist.
./var/lib/gems/2.5.0/doc/did_you_mean-1.2.1/rdoc/fonts/Lato-Regular.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-Regular.ttf' does not exist.
./var/lib/gems/2.5.0/doc/did_you_mean-1.2.1/rdoc/fonts/Lato-RegularItalic.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-RegularItalic.ttf' does not exist.
./var/lib/gems/2.5.0/doc/csv-3.0.0/rdoc/js/jquery.js: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/js/jquery.js' does not exist.
./var/lib/gems/2.5.0/doc/csv-3.0.0/rdoc/fonts/Lato-Light.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-Light.ttf' does not exist.
./var/lib/gems/2.5.0/doc/csv-3.0.0/rdoc/fonts/Lato-LightItalic.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-LightItalic.ttf' does not exist.
./var/lib/gems/2.5.0/doc/csv-3.0.0/rdoc/fonts/Lato-Regular.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-Regular.ttf' does not exist.
./var/lib/gems/2.5.0/doc/csv-3.0.0/rdoc/fonts/Lato-RegularItalic.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-RegularItalic.ttf' does not exist.
./var/lib/gems/2.5.0/doc/bigdecimal-1.3.5/rdoc/js/jquery.js: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/js/jquery.js' does not exist.
./var/lib/gems/2.5.0/doc/bigdecimal-1.3.5/rdoc/fonts/Lato-Light.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-Light.ttf' does not exist.
./var/lib/gems/2.5.0/doc/bigdecimal-1.3.5/rdoc/fonts/Lato-LightItalic.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-LightItalic.ttf' does not exist.
./var/lib/gems/2.5.0/doc/bigdecimal-1.3.5/rdoc/fonts/Lato-Regular.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-Regular.ttf' does not exist.
./var/lib/gems/2.5.0/doc/bigdecimal-1.3.5/rdoc/fonts/Lato-RegularItalic.ttf: Hard-link target './var/lib/gems/2.5.0/doc/test-unit-3.2.8/rdoc/fonts/Lato-RegularItalic.ttf' does not exist.

So now I’m trying to the uninstall etc, did_you_mean, csv, bigdecimal gems and see how that works.

edit - that worked! so basically I checked the error message for ruby gems causing the problem, and iteratively removed gems until I was able to fix it.

Is there any update to this? I have the same problem.

I’m getting this same error now, after “GA”.

PS C:\Users\haako> 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
Importing the distribution failed.
./home/haakoo/gems/doc/test-unit-3.3.3/rdoc/js/jquery.js: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/js/jquery.js' does not exist.
./home/haakoo/gems/doc/test-unit-3.3.3/rdoc/fonts/Lato-Light.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-Light.ttf' does not exist.
./home/haakoo/gems/doc/test-unit-3.3.3/rdoc/fonts/Lato-LightItalic.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-LightItalic.ttf' does not exist.
./home/haakoo/gems/doc/test-unit-3.3.3/rdoc/fonts/Lato-Regular.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-Regular.ttf' does not exist.
./home/haakoo/gems/doc/test-unit-3.3.3/rdoc/fonts/Lato-RegularItalic.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-RegularItalic.ttf' does not exist.
./home/haakoo/gems/doc/stringio-0.0.2/rdoc/js/jquery.js: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/js/jquery.js' does not exist.
./home/haakoo/gems/doc/stringio-0.0.2/rdoc/fonts/Lato-Light.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-Light.ttf' does not exist.
./home/haakoo/gems/doc/stringio-0.0.2/rdoc/fonts/Lato-LightItalic.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-LightItalic.ttf' does not exist.
./home/haakoo/gems/doc/stringio-0.0.2/rdoc/fonts/Lato-Regular.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-Regular.ttf' does not exist.
./home/haakoo/gems/doc/stringio-0.0.2/rdoc/fonts/Lato-RegularItalic.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-RegularItalic.ttf' does not exist.
./home/haakoo/gems/doc/rdoc-6.1.1/rdoc/js/jquery.js: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/js/jquery.js' does not exist.
./home/haakoo/gems/doc/rdoc-6.1.1/rdoc/fonts/Lato-Light.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-Light.ttf' does not exist.
./home/haakoo/gems/doc/rdoc-6.1.1/rdoc/fonts/Lato-LightItalic.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-LightItalic.ttf' does not exist.
./home/haakoo/gems/doc/rdoc-6.1.1/rdoc/fonts/Lato-Regular.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-Regular.ttf' does not exist.
./home/haakoo/gems/doc/rdoc-6.1.1/rdoc/fonts/Lato-RegularItalic.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-RegularItalic.ttf' does not exist.
./home/haakoo/gems/doc/rake-12.3.2/rdoc/js/jquery.js: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/js/jquery.js' does not exist.
./home/haakoo/gems/doc/rake-12.3.2/rdoc/fonts/Lato-Light.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-Light.ttf' does not exist.
./home/haakoo/gems/doc/rake-12.3.2/rdoc/fonts/Lato-LightItalic.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-LightItalic.ttf' does not exist.
./home/haakoo/gems/doc/rake-12.3.2/rdoc/fonts/Lato-Regular.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-Regular.ttf' does not exist.
./home/haakoo/gems/doc/rake-12.3.2/rdoc/fonts/Lato-RegularItalic.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-RegularItalic.ttf' does not exist.
./home/haakoo/gems/doc/psych-3.1.0/rdoc/js/jquery.js: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/js/jquery.js' does not exist.
./home/haakoo/gems/doc/psych-3.1.0/rdoc/fonts/Lato-Light.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-Light.ttf' does not exist.
./home/haakoo/gems/doc/psych-3.1.0/rdoc/fonts/Lato-LightItalic.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-LightItalic.ttf' does not exist.
./home/haakoo/gems/doc/psych-3.1.0/rdoc/fonts/Lato-Regular.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-Regular.ttf' does not exist.
./home/haakoo/gems/doc/psych-3.1.0/rdoc/fonts/Lato-RegularItalic.ttf: Hard-link target './home/haakoo/gems/doc/tzinfo-2.0.0/rdoc/fonts/Lato-RegularItalic.ttf' does not exist.
./home/haakoo/gems/doc/power_assert-1.1.4/rdoc/js/jquery.js
PS C:\Users\haako>

Any ideas, or should I just delete it and start over fresh? Any steps I can do to get better debug data?