6

A friend of mine just showed me a neat built-in utility called screen that, long story short, allows you to create instances of the terminal.

I am running Windows 10 and trying to use this utility with Bash on Ubuntu on Windows, but since it was a built-in utility, I didn't expect any problems. After playing with it on a different computer, I went to start an instance on mine with screen -S hello and all I got back was

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

I googled the error and the first thing that came up was this site which said to try

sudo /etc/init.d/screen-cleanup start

which I did with little luck. Now with the same screen command all that happens is

[screen is terminating]
[11:44:25 ~]> _

with no other explanation. I made sure that there were no instances left running with screen -ls and got No Sockets found in /home/daniel/.screen.. I went back to google to then fix this issue but all of the questions / answers I found were for CentOS (which I'm not running, and just to be clear, cat /etc/issue returns Ubuntu 14.04.4 LTS \n \l). I did try some of their suggestions anyway, trying all of these:

sudo chmod 2775 /usr/bin/screen
sudo chmod 755 /usr/bin/screen
sudo chmod 777 /usr/bin/screen
sudo chmod u+s /usr/bin/screen
sudo chmod 755 /var/run/screen

as well as chmod 700 ~/.screen after creating and exporting a new SCREENDIR.

I'm not trying to use any special programs, not trying to ssh, just want to use screen natively on my bash/Ubuntu console.

Any help is appreciated!

12
  • Have you tried starting screen without the parameters? If it opens, then split the terminal with Ctrl-a S.
    – bashBedlam
    Aug 30, 2016 at 17:31
  • @bashBedlam same result, just terminates. Aug 30, 2016 at 18:57
  • Can toy try inserting the line shell /bin/bash in ~/.screenrc ?
    – stalet
    Sep 19, 2016 at 6:07
  • Try command screen bash. If that fails and you feel confident examining failed system calls you could try strace -f -o trc -v screen bash and then examine file trc. More info on strace is available here: wiki.ubuntu.com/Strace
    – sмurf
    Sep 19, 2016 at 6:31
  • 1
    I'm pretty certain Dustin Kirkland said screen and tmux don't work.
    – muru
    Sep 20, 2016 at 7:50

3 Answers 3

3

I googled the error and the first thing that came up was this site which said to try

Use Windows Bash Shell sources for Windows Bash Shell, not native Ubuntu. The 2 systems are not interchangeable. Regarding Bash itself you can get away with it but tools like "screen" and "tmux" have specific needs that Windows Bash Shell just does not have (yet!). Any command you use in Ubuntu is bound to fail on Windows Bash Shell.

I'm not trying to use any special programs, not trying to ssh, just want to use screen natively on my bash/Ubuntu console.

Yes, you do: "screen" IS a special program.

You wont succeed to get this running unless you can hack your way around software. "screen" is not supported in Windows Bash Shell (yet!). Windows 10 build 14361 will introduce "tmux" (and I assume "screen" will then work too) and that version seems to be an "insider preview build", not released yet to the general public.

1
  • though strange earlier I was able to build and run screen successfully in bash inside windows. But now in another system after a month I am not able to do with the latest windows 10 build. Oct 25, 2016 at 5:44
1

tmux works in Windows 10 bash. It is the same as screen, like so:

tmux      # starts a new tmux session

ctrl-b c  # new tab

ctrl-b 0  # switch to tab 0

ctrl-b d  # detach

tmux a    # re-attach to your previous session

ctrl-b ?  # for help
1

I received the same error trying to start screen for first time:

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

Ran:

sudo screen

and was then able to run screen (although my usage is somewhat limited)

1
  • 2
    hmm... I wonder whether that is a good idea...
    – Zanna
    Feb 15, 2018 at 18:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .