Im stuck:
I have a Vagrant box with a server, when i logging with vagrant ssh, and launch my script to start the server in a detached screen session, is ok:
vagrant ssh
screen -d -m -S sesionServer bash run_server.sh
i can see my screen session active with screen -list and the server is running OK.
but i need launch all this in a single command, im trying to execute:
vagrant ssh -c 'screen -d -m -L -S test1 bash run_server.sh'
but I only have a "connection to 127.0.0.1 closed.
How can i execute a screen command with vagrant ssh?
I believe this is the same question?
TL;DR
vagrant ssh
doesn't allocate pty to ssh session. Usevagrant ssh -- -t
prefix before screen command.You can also set this in
Vagrantfile
:VAGRANTFILE_API_VERSION = "2"