2

I have vagrant and an ubuntu server 16.04 box started with it.

By using vagrant ssh command everything is fine if you need just one terminal, but I need many terminal sessions not just one because I have to start 3 nodejs processes and some other tasks and need to monitor them while running.

Have searched a lot but haven't found any information about this issue. Over vagrant ssh can't event use ubuntu server virtual terminals ttys-

Kristi Jorgji
  • 1,154
  • 1
  • 14
  • 39

2 Answers2

4

The easiest is to have as many terminal session open on your host than you need and for each you can run vagrant ssh.

If you want to have a single vagrant ssh running, you can look at software like screen or tmux

ggorlen
  • 44,755
  • 7
  • 76
  • 106
Frederic Henri
  • 51,761
  • 10
  • 113
  • 139
  • Thanks, I know about screen wil check tmux now. Also I have tried vagrant ssh but it allows me to ssh only in one terminal for some weird issue can't ssh more then 1 session at a time – Kristi Jorgji Apr 09 '17 at 09:09
  • So I would like a solution to see all screens/terminals on the same time, having multiple windows open. Is there any screen but that allows that ? – Kristi Jorgji Apr 09 '17 at 09:48
  • what is your box that you cannot run multiple ssh sessions against it ? this is weird, there should not be such limitation – Frederic Henri Apr 10 '17 at 09:06
  • Box is ubuntu server 16.04 and of course almost any ubuntu allows multiple ssh, but I wanted to say that opening another terminal in my host and executing the command vagrant ssh gave me an error something like machine is busy. This error happened on windows, trying by having host ubuntu (have dual boot) and can ssh multiple times by opening many terminals... – Kristi Jorgji Apr 10 '17 at 12:26
  • OK on windows when I open another cmd (after being already ssh logged with one cmd) and try vagrant ssh I get this message: "VM must be running to open SSH connection. Run `vagrant up` to start the virtual machine." – Kristi Jorgji Apr 10 '17 at 21:03
  • are you sure you are within the right directory ? can you run `vagrant global-status` and run `vagrant ssh – Frederic Henri Apr 11 '17 at 04:52
  • Sorry for late reply, runned your command and machine is shown as state poweroff while I have logged in other cmd and everything works fine (can access web etc)... – Kristi Jorgji Apr 21 '17 at 18:39
1

So I needed two terminal tabs with two separate processes ( local host py server ) AND SaSS for CSS3 compiling . This is what worked for me ; I should mention that I am running virtualenv IN Vagrant and ON VirtualBox .

Open a new Terminal tab . SSH from your Vagrant folder . (vagrant ssh) Activate your virtual machine . (virtualenv)

Run SaSS compiler ( 2nd process )

Hope this helps . Everyone seems to have unique dev environments so it can be tricky .