Ubuntu – “[screen is terminating]” Immediately, Never Creates Screen Instance

bashcommand linegnu-screenwindows-subsystem-for-linux

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!

Best Answer

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.

Related Question