WSL icon indicating copy to clipboard operation
WSL copied to clipboard

screen - open fifo /var/run/screen/S-root/2904.tty.localhost: No such file or directory

Open atari opened this issue 10 years ago • 15 comments

apt-get install screen

screen open fifo /var/run/screen/S-root/2904.tty.localhost: No such file or directory

atari avatar Apr 07 '16 17:04 atari

@atari MS know about that, they are working to fix this. You can read about this there: https://insights.ubuntu.com/2016/03/30/ubuntu-on-windows-the-ubuntu-userspace-for-windows-developers/

patryk9200 avatar Apr 07 '16 18:04 patryk9200

Thanks for reporting the issue. Some fixes were made recently to support tmux, but from strace it appears that screen is still blocked due to a lack of packet mode on ptmx (TIOCPKT).

Please give us feedback on the user voice page so we can prioritize.

stehufntdev avatar Jun 01 '16 17:06 stehufntdev

stephanie@ASYLUM:~$ screen Cannot make directory '/var/run/screen': Permission denied

build 14393

sdaugherty avatar Aug 04 '16 16:08 sdaugherty

You have to run sudo screen the first time, but otherwise, screen should now work.

bitcrazed avatar Sep 28 '16 22:09 bitcrazed

sudo screen starts you in root, that's bad. We need screen without privilege escalation.

archon810 avatar Jul 10 '17 22:07 archon810

@archon810 - you only need to run screen as root the first time.

sudo screen
exit
screen

benhillis avatar Jul 10 '17 22:07 benhillis

This solution works better for me.

https://www.systutorials.com/qa/1639/screen-reporting-cannot-directory-screen-permission-denied

Screen works without root now.

I use SecureCRT with logon action of screen -xR, which seems to somehow execute it without running .bashrc first, but this fixes it: export SCREENDIR=$HOME/.screen; screen -xR

archon810 avatar Jul 10 '17 22:07 archon810

@archon810 - agreed, that's another way to do it.

benhillis avatar Jul 10 '17 22:07 benhillis

@benhillis I'm not sure if you're working on this, but it's a pretty simple issue to fix and the only one standing between screen working out of the box like tmux does. Would be great to finish the 1% left from making it 100%.

archon810 avatar Jul 10 '17 22:07 archon810

sudo screen only fixes the problem until the next time the WSL session is restarted. Then you're back to square one.

michaelmhoffman avatar Nov 20 '17 19:11 michaelmhoffman

@michaelmhoffman - It is looking like this is kind of a dupe of #2530 (correct me if I am wrong). The SCREENDIR work-around seems like the right approach for WSL under the present circumstances. I don't run screen much myself, but if there is a well-formed actionable to bring screen over the aforementioned 1% you could open a new issue; this was closed a year ago. But I am thinking anything requested would fall under a "/var/run isn't the awesome on WSL right now" umbrella.

therealkenc avatar Nov 20 '17 19:11 therealkenc

Basically, although it's /var/run not /run in this case. sudo /etc/init.d/screen-cleanup start will also fix the problem, but only until the WSL session ends. Yes, I am using the SCREENDIR workaround myself:

if [[ "$(uname -r)" == *Microsoft ]]; then
    export SCREENDIR="$HOME/.screen"
fi

michaelmhoffman avatar Nov 20 '17 20:11 michaelmhoffman

This sounds v. like #2350 wherein tmux fails to run after restarting openSUSE session; caused by missing /run/ tmpfs folder.

Please try this:

  1. Close all WSL sessions/instances
  2. Open Ubuntu instance
  3. Run systemd-tmpfiles
  4. Try running screen

Expected: Screen should now work Actual: ?

bitcrazed avatar Nov 20 '17 22:11 bitcrazed

I think you mean #2530 as pointed out by @therealkenc. It works but only until the next WSL session starts.

Microsoft Windows [Version 10.0.16299.19]
(c) 2017 Microsoft Corporation. All rights reserved.

C:\Users\mhoffman>bash

$ uname -a
Linux mhoffman-m02 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014 x86_64 x86_64 x86_64 GNU/Linux

$ sudo systemd-tmpfiles --create
[sudo] password for mhoffman:
[/usr/lib/tmpfiles.d/tmp.conf:15] Failed to replace specifiers: /tmp/systemd-private-%b-*
[/usr/lib/tmpfiles.d/tmp.conf:16] Failed to replace specifiers: /tmp/systemd-private-%b-*/tmp
[/usr/lib/tmpfiles.d/tmp.conf:17] Failed to replace specifiers: /var/tmp/systemd-private-%b-*
[/usr/lib/tmpfiles.d/tmp.conf:18] Failed to replace specifiers: /var/tmp/systemd-private-%b-*/tmp
[/usr/lib/tmpfiles.d/var.conf:14] Duplicate line for path "/var/log", ignoring.

$ screen
/var/run/utmp: No such file or directory
[screen successfully starts here]
[screen is terminating]

$ logout

C:\Users\mhoffman>bash

$ screen
Cannot make directory '/var/run/screen': Permission denied

michaelmhoffman avatar Nov 21 '17 15:11 michaelmhoffman

Thanks @michaelmhoffman. Since you've verified it works (temporarily) and this issue tracker is long closed since the fall of 2016, follow further developments over in #2530. /var/run is just a symlink to /run FWIW.

therealkenc avatar Nov 21 '17 17:11 therealkenc