LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-02-2017, 06:08 AM   #1
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Rep: Reputation: 120Reputation: 120
Remote connection to one session


I have set up a small Centos machine in our office to run Oracle VirtualBox. Unfortunately this is GUI based, and should only have one instance running. I want multiple people to be able to start up VM's, change settings etc (not simultaneously). The easiest way for this is that we have a single user and they just go to the machine and unlock the session, however I don't really want to have to have a monitor/keyboard and mouse attached - I want to just stick the machine under a desk and people can remote connect onto it to manage the running program.
Is the easiest way to achieve this to use VNC? I don't think I can use standard X forwarding because each connection would be a new session, which isn't what I want.
 
Old 05-02-2017, 06:19 AM   #2
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 20,232

Rep: Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836Reputation: 6836
yes, VNC could be a solution, if you are familiar with that.
 
Old 05-02-2017, 06:43 AM   #3
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Original Poster
Rep: Reputation: 120Reputation: 120
Quote:
Originally Posted by pan64 View Post
yes, VNC could be a solution, if you are familiar with that.
Do you know whether there is a better alternative? I've just always found VNC a bit clunky.
 
Old 05-02-2017, 08:28 AM   #4
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,363

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by devnull10 View Post
Do you know whether there is a better alternative? I've just always found VNC a bit clunky.
In my opinion, there is a better alternative (... if I understand your objective properly ...), which I use myself on my home network.

Virtualbox (as with KVM/libvirt/QEMU) can be run headlessly, meaning that you remotely connect to the VM's running on the server using remote desktop. You don't even need a GUI on the server at all (hence the "headless" appellation ...). You configure the VM's on the server to "export" their display to a specific TCP port and the client connects to the IP address of the server and the specific port you set using a remote desktop client (CLI, GUI-based ... doesn't matter ...).

If this is what you're interested in doing, let us know. I'd be happy to help you with details as needed.

Cheers,
 
Old 05-02-2017, 08:52 AM   #5
r3sistance
Senior Member
 
Registered: Mar 2004
Location: UK
Distribution: CentOS 6/7
Posts: 1,375

Rep: Reputation: 217Reputation: 217Reputation: 217
for a LAN, VNC is fine, for WAN there are probably better alternatives such as nomachine/NX, tho most would probably just end out tunneling VNC over SSH in those situations.

Personally I use KVM for my home set-up, which has both CLI and GUI tools.
 
Old 05-02-2017, 11:02 AM   #6
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Original Poster
Rep: Reputation: 120Reputation: 120
Quote:
Originally Posted by Rickkkk View Post
In my opinion, there is a better alternative (... if I understand your objective properly ...), which I use myself on my home network.

Virtualbox (as with KVM/libvirt/QEMU) can be run headlessly, meaning that you remotely connect to the VM's running on the server using remote desktop. You don't even need a GUI on the server at all (hence the "headless" appellation ...). You configure the VM's on the server to "export" their display to a specific TCP port and the client connects to the IP address of the server and the specific port you set using a remote desktop client (CLI, GUI-based ... doesn't matter ...).

If this is what you're interested in doing, let us know. I'd be happy to help you with details as needed.

Cheers,
Hi,
I will be remote connecting to the VM's once they're started - they're all ssh enabled. This is so that a user can log in and see what VM's are started, start up new VM's etc... I don't see any option to do that in the VB options? No matter what I do, it seems to launch a GUI:

Code:
# virtualbox -h
Oracle VM VirtualBox Manager 5.1.22
(C) 2005-2017 Oracle Corporation
All rights reserved.

Usage:
  --startvm <vmname|UUID>    start a VM by specifying its UUID or name
  --separate                 start a separate VM process
  --normal                   keep normal (windowed) mode during startup
  --fullscreen               switch to fullscreen mode during startup
  --seamless                 switch to seamless mode during startup
  --scale                    switch to scale mode during startup
  --no-startvm-errormsgbox   do not show a message box for VM start errors
  --restore-current          restore the current snapshot before starting
  --no-aggressive-caching    delays caching media info in VM processes
  --fda <image|none>         Mount the specified floppy image
  --dvd <image|none>         Mount the specified DVD image
  --dbg                      enable the GUI debug menu
  --debug                    like --dbg and show debug windows at VM startup
  --debug-command-line       like --dbg and show command line window at VM startup
  --debug-statistics         like --dbg and show statistics window at VM startup
  --no-debug                 disable the GUI debug menu and debug windows
  --start-paused             start the VM in the paused state
  --start-running            start the VM running (for overriding --debug*)

Expert options:
  --disable-patm             disable code patching (ignored by AMD-V/VT-x)
  --disable-csam             disable code scanning (ignored by AMD-V/VT-x)
  --recompile-supervisor     recompiled execution of supervisor code (*)
  --recompile-user           recompiled execution of user code (*)
  --recompile-all            recompiled execution of all code, with disabled
                             code patching and scanning
  --execute-all-in-iem       For debugging the interpreted execution mode.
  --warp-pct <pct>           time warp factor, 100% (= 1.0) = normal speed
  (*) For AMD-V/VT-x setups the effect is --recompile-all.

The following environment (and extra data) variables are evaluated:
  VBOX_GUI_DBG_ENABLED (GUI/Dbg/Enabled)
                             enable the GUI debug menu if set
  VBOX_GUI_DBG_AUTO_SHOW (GUI/Dbg/AutoShow)
                             show debug windows at VM startup
  VBOX_GUI_NO_DEBUGGER       disable the GUI debug menu and debug windows
 
Old 05-02-2017, 11:14 AM   #7
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,363

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Hey devnull10,

Check out the extensive Virtualbox documentation on the vboxmanage command, especially the modifyvm and controlvm options.

For example, to list existing virtual machines:

Code:
vboxmanage list vms
... to list running virtual machines:

Code:
vboxmanage list runningvms
There are also commands to configure every aspect of the VMs from the command line, launch headless VM sessions ... tons of stuff. Take a look and let us know if you want some help for specific things.

Cheers,
 
Old 05-02-2017, 11:55 AM   #8
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Original Poster
Rep: Reputation: 120Reputation: 120
Ah excellent - that looks perfect. I can also wrap the above commands in a nice shell script that displays the list of running VM's on login, allows users to select which to start from a menu option etc. I'll take a look and let you know if I have any issues.

Thanks
 
Old 05-02-2017, 12:14 PM   #9
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,363

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by devnull10 View Post
Ah excellent - that looks perfect. I can also wrap the above commands in a nice shell script that displays the list of running VM's on login, allows users to select which to start from a menu option etc. I'll take a look and let you know if I have any issues.

Thanks
Excellent - don't hesitate with any questions you may have. I've been running a headless Vbox server for several years - works well. You might be interested in setting up phpvirtualbox to manage the VMs remotely. It's a web interface resembling the usual Vbox GUI.

Cheers.
 
Old 05-04-2017, 09:03 AM   #10
devnull10
Member
 
Registered: Jan 2010
Location: Lancashire
Distribution: Slackware Stable
Posts: 572

Original Poster
Rep: Reputation: 120Reputation: 120
I had a quick look at vboxheadless and it looks like it will be perfect for what I want. I presume you have nohup it? I don't suppose you have any useful scripts you could share?
 
Old 05-04-2017, 09:31 AM   #11
Rickkkk
Senior Member
 
Registered: Dec 2014
Location: Montreal, Quebec and Dartmouth, Nova Scotia CANADA
Distribution: Arch, AntiX, ArtiX
Posts: 1,363

Rep: Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511Reputation: 511
Quote:
Originally Posted by devnull10 View Post
I had a quick look at vboxheadless and it looks like it will be perfect for what I want. I presume you have nohup it? I don't suppose you have any useful scripts you could share?
Hey devnull - not sure what your first question is - maybe a typo ?

As to scripts - I don't use any so can't help you there.

I have 7-8 virtual machines defined on my headless server (which I also use as my main file server, btw), and 4-5 are generally running at any given time. The vm's vary in OS-type : several Windows versions, linux distros ... At one point I was even experimenting with Macs and had an OS/2 machine up and running (!).

I manage them mostly through phpvirtualbox from any computer on my home network, or at times from the command line on the server itself via an SSH session.

Let me know if you need any help.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Can't SSH to remote machine: Connection closed by remote host Avatar Linux - Networking 35 10-23-2017 12:21 AM
Create a vnc session from Redhat 5 Linux to windows 2003(Remote Desktop Connection) J_U_D_E Linux - General 1 03-25-2012 06:31 AM
Remote X Session Help jmikeneedham Linux - Desktop 1 05-26-2009 03:19 PM
Remote X Session ComputerErik Red Hat 2 06-05-2008 09:15 PM
Remote X Session Help implant25 Linux - Software 1 09-05-2005 08:39 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 10:29 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration