WSL icon indicating copy to clipboard operation
WSL copied to clipboard

/proc/sys/kernel/random/uuid (and others) are missing

Open bogen opened this issue 10 years ago • 16 comments

  • Multiple items are missing from /proc/sys/kernel/random
  • My WSL environment:
    • Edition: Windows 10 Enterprise
    • Version: 1607
    • OS Build: 14393.0
  • Expected results (where a different uuid is presented each time):
$ cat /proc/sys/kernel/random/uuid
e1f8cc36-7b52-41ea-947e-15001e5cac8d
  • Actual results:
$ cat /proc/sys/kernel/random/uuid
cat: /proc/sys/kernel/random/uuid: No such file or directory
  • A program should just be able to read the contents of /proc/sys/kernel/random/uuid and get a fresh UUID each time.
  • from man 4 random (documentation provided for ubuntu trusty):
The read-only files uuid and boot_id contain random strings like 6fd5a44b-35f4-4ad4-a9b9-6b9be13e1fe9.
       The former is generated afresh for each read, the latter was generated once.
  • Expecting something like the following as the contents of /proc/sys/kernel/random
$ ls -l /proc/sys/kernel/random
total 0
-r--r--r-- 1 root root 0 Aug 16 13:45 boot_id
-r--r--r-- 1 root root 0 Sep  2 00:39 entropy_avail
-r--r--r-- 1 root root 0 Sep  2 00:39 poolsize
-rw-r--r-- 1 root root 0 Sep  2 00:39 read_wakeup_threshold
-rw-r--r-- 1 root root 0 Sep  2 00:39 urandom_min_reseed_secs
-r--r--r-- 1 root root 0 Sep  2 00:39 uuid
-rw-r--r-- 1 root root 0 Sep  2 00:39 write_wakeup_threshold
  • Instead got this:
$ ls -l /proc/sys/kernel/random
ls: cannot access /proc/sys/kernel/random: No such file or directory

bogen avatar Sep 17 '16 16:09 bogen

As I said in the other thread, these are not oversights. Procfs is being slowly extended in the new builds, but they aren't necessarily a priority. Are these omissions blocking a use case you have right now?

If not, why are you posting this? It shouldn't be surprising that WSL is unfinished. It doesn't even cover the whole syscall surface and the latest Linux Testing Suite results showed it failing like 1/4 of tests due to unimplemented things. IMO, more and better syscall support as well as better filesystem performance are much more important problems, and this stuff in procfs is mainly just nice to have. It's like you've entered a house with no roof on it and are complaining about the lack of wallpaper.

fpqc avatar Sep 17 '16 16:09 fpqc

@fpqc this is not actually blocking me at the moment. But I did not just go looking for it, I ran into while trying https://github.com/Linuxbrew/brew on WSL.

Yes, better syscall support is more important, but /proc and /sys are also kernel interaces that a lot of applications depend on.

I am not randomly looking for issues to report.

The reason I was tryhing Linuxbrew is because the package set for Ubuntu Trusty is very old, even when fully updated, and a lot of the development I do depends on more current distros (Ubuntu Xenial, Arch Linux, etc).

With Linuxbrew I can install newer package versions.

Why are you replying to me the way you are? When I'm trying to do stuff on WSL to incorporate it into my work flow, should I not report issues that I run into? I'm trying to be helpful, not to nitpick on superflous items. See https://github.com/Microsoft/BashOnWindows/issues/622 for an example of that.

bogen avatar Sep 17 '16 17:09 bogen

@bogen Three things: First, sorry if I was being a bit snippy.

Second, if you want to use Xenial or Arch (I don't suggest arch, bc chroot is one of the missing syscalls), use @RoliSoft 's WSL-distro-switcher python scripts (make sure to remove the word sample from the post-install hook file, or you will not have some essential packages installed. Read the readme and you will understand.)

Third, did the lack of any of these kernel information features break linux-brew while you were trying to build something?

fpqc avatar Sep 17 '16 17:09 fpqc

@fpqc. Thanks, I understand. In the future I will try to provide relevant background information as to how I stumbled upon the issue.

I ran into several other issues with linux-brew on WSL, but since I've not tried linux-brew on a native ubuntu-trusty install I don't have definitive indicators as to which platform the issues are on.

I will look into @RoliSoft 's WSL-distro-switcher, thanks for pointing it out to me.

bogen avatar Sep 17 '16 18:09 bogen

I just hit this as well. I have some bash scripts that generate vs project filters based on directory contents. I need guids and was using this there

robotdad avatar Nov 04 '16 23:11 robotdad

Thanks for pinging this thread, sorry I didn't see this earlier. This looks like it will be super easy to implement so I've just filed a task to get this taken care of.

I'll look at the other files in the /proc/sys/kernel/random/ directory but they might not be as straightforward.

benhillis avatar Nov 05 '16 00:11 benhillis

I just hit this bug too - in the configuration script of SQL Server for Linux. Of all the things to fail ...

pkanavos avatar Nov 21 '16 15:11 pkanavos

this is also concerning /proc/sys/kernel/random/boot_id which is apparently required by flatpak

maxfragg avatar May 22 '17 17:05 maxfragg

Also hitting this issue on flatpack. error: Failed to open file '/proc/sys/kernel/random/boot_id': No such file or directory Any workaround?

jacano avatar Oct 08 '17 10:10 jacano

also hitting the same wall as @jacano. i'd really like if this were fixed. Flatpaks are a complete no-go on WSL right now.

ghost avatar Oct 20 '17 18:10 ghost

Also hitting the same while trying to install the MonoDevelop flatpak or any other flatpak package.

MathieuDSTP avatar Oct 22 '17 15:10 MathieuDSTP

News on this? This is a blocker for me

jacano avatar Nov 14 '17 22:11 jacano

Well, /proc/sys/kernel/random/uuid does show up now, but not the others.

$ ls -l /proc/sys/kernel/random total 0 -r--r--r-- 1 root root 0 Nov 14 16:20 uuid

bogen avatar Nov 14 '17 22:11 bogen

any news?

chromity avatar Jun 11 '18 14:06 chromity

These should both be present in 1803.

benhillis avatar Jun 11 '18 15:06 benhillis

Nice, great work guys!

jacano avatar Jun 11 '18 20:06 jacano