[OpenIndiana-discuss] Running VirtualBox

Jim Klimov jim at cos.ru
Thu Aug 9 01:23:06 UTC 2012


2012-08-09 5:04, Edward Ned Harvey пишет:
> I installed openindiana server (headless).  I want to run VirtualBox.  (At
> least, I think I want to run VirtualBox, to host windows & linux guests, but
> I'm open to suggestions.)
>
> How does one run VirtualBox remotely?  I tried remoting in with X
> forwarding, and then launching VirtualBox.  It starts out well, but when I
> try to create my first VM, it complains, permission denied trying to access
> USB subsystem.  So I guess it needs to run as root ... But I can't login as
> root over ssh, and I can't "sudo VirtualBox" because X11 forwarding gets
> denied.  (I tried every variation of xhost + and setting DISPLAY that I can
> think of, but haven't gotten sudo X applications to run yet.)
>
> What is everyone else doing?
>
> Eventually, I'll want to make my guest VM's startup/shutdown automatically,
> without needing a GUI client connected.  And it sure would be nice to be
> able to connect/disconnect to the GUI console of the guests when I want
> to...
>
> Thanks for suggestions.

I use a VNC server bound to localhost, which you can forward via SSH
for actual X11 graphical connections to your workstation. To this
VNC session you "xhost +" permit your user/zone who executes VMs.
At least as of VirtualBox 3.x, it could run as an unprivileged user
(non-root), and in a local zone too, so USB should not be a problem.
If the VNC server is owned by root, rather insecurely for the paranoic
at least, you can use it to spawn root-owned shells and ultimately
VirtualBox GUI processes. Alternately look at "su" (without "-")
to inherit your current user's envvars, including DISPLAY, or
try to wrap VirtualBox invokation along with shell-setting into
a script and "sudo" that. Paranoic stuff might not be required
really, if you only fire up this VNC server to configure a VBox...

For headless startup/shutdown of prepared VMs (as usual SMF service
instances), again, see the http://vboxsvc.sourceforge.net/ project,
feel free to ask questions or add RFEs if I still missed something
useful ;)
The method script can also be used as a CLI script to switch VMs
from SMF to GUI mode and back via "savestate" to disk.

For most of the time you can use RDP consoles to VMs instead, but
yes GUI can be useful. Alternately, there are some Web-GUIs to
VirtualBox which essentially recreate the X11 GUI equivalent in
HTML (for general administrative tasks without need for X11), and
often include an RDP client to conveniently connect to consoles.

HTH,
//Jim Klimov



More information about the OpenIndiana-discuss mailing list