running VBox on OS X Server

Discussions related to using VirtualBox on Mac OS X hosts.
satanmat
Posts: 2
Joined: 3. Mar 2009, 18:50

running VBox on OS X Server

Post by satanmat »

We are lucky enough to have an Xserve 8 core 10 GB Ram, and I was hoping to use it to host some VMs running on VirtualBox. I've been able to get VB installed and up and running, but i seem to have an issue with it crashing the Xserve; on my macbook pro (10.5.6) I've had no problems whatsoever.

So, here are the questions.

1, is anyone else running Virtualbox on an Xserve, or on OS X Server?
1a, what OSs? (i've seen only one post alluding to anyone doing this and they were running Ubuntu) -- I had W2k8 and W2k3 up and running and they seemed fine, as guests.

2, is there something in Virtualbox that does not play well with OS X Server? -- anyone have any hints, or thoughts?

thanks in advance.

./s
bsenftner
Posts: 2
Joined: 5. Mar 2009, 04:38

Re: running VBox on OS X Server

Post by bsenftner »

I am also interested in this issue.
We are just starting an evaluation of VirtualBox for use on an Xserve as well, to host multiple WinXP guests running command line software only available on WinXP.
satanmat
Posts: 2
Joined: 3. Mar 2009, 18:50

Re: running VBox on OS X Server

Post by satanmat »

I don't like responding to my own posts, but since i seems to be one of the few people using VBox on an os x server, here goes.

i have it installed. (not impressive)
i have two VMs, one W2k3 and one w2k8. (again not impressive)
i have them both running. (at this I'm impressed)

the issue I've noticed is this, when I start them while logged in to the os x GUI, Virtual box hangs. both VMs run, but osx server (thinks?) that Virtualbox is hanging and wont let me logout.

but if I ssh into the server I can get them to both run. when I run 'top' in the terminal I can see two vboxheadless processes running. (which is good and what I am looking for) and I can RDP into them both (again very good)

so what's up with the crashy?

so, it works. but there are some issues.

now i have a real question that most likely needs to be ask seperatly, I know that there is a 3GB limit per VM. Is there _also_ a 3GB limit for all running VMs? eg w2k3 has 1.5 GB assigned to it can i assign more than 1.5 GB to w2k8? it seems so far that when I do, things get crashy.

thoughts?
borgo1971
Posts: 24
Joined: 11. Feb 2009, 18:32
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Windows Server 2003
Location: Italy

Re: running VBox on OS X Server

Post by borgo1971 »

satanmat wrote:1, is anyone else running Virtualbox on an Xserve, or on OS X Server?
./s
We have it running on our server: a MacPro 4x2.66 with 7Gb ram and Mac OS X 10.5.6 Server. We run two VirtualBox headless, with Windows 2003 guest.
I had no great problems to run even the same VM with VirtualBox GUI console.
The unique problem I get, are:
- I'm not able to start virtualbox on Server startup;
- strange CPU usage I've spoke in another topic.
chip
Posts: 10
Joined: 6. Apr 2009, 06:32
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Windows
Location: Ontario

Re: running VBox on OS X Server

Post by chip »

satanmat wrote: 1, is anyone else running Virtualbox on an Xserve, or on OS X Server?
1a, what OSs? (i've seen only one post alluding to anyone doing this and they were running Ubuntu) -- I had W2k8 and W2k3 up and running and they seemed fine, as guests.
2, is there something in Virtualbox that does not play well with OS X Server? -- anyone have any hints, or thoughts?
On a 2008-spec Xserve I've got VirtualBox 2.1.4 running quite happily on OS X Server 10.5.6 with a 32 bit Windows 2008 Standard guest with 3072MB RAM. Never had any dramas, it all worked.

It might be informative if you try and run it and when it crashes look at the system logs with the Console app.
SlaunchaMan
Posts: 65
Joined: 6. Apr 2009, 22:28
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04
Location: Detroit, MI
Contact:

Re: running VBox on OS X Server

Post by SlaunchaMan »

Have you tried using a LaunchDaemon to start the VBoxHeadless process? Here's an example:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" \
"http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<dict>
		<key>Label</key>
		<string>edu.umich.sites.vm</string>
		<key>ServiceDescription</key>
		<string>VirtualBox</string>
		<key>ProgramArguments</key>
		<array>
			<string>/usr/bin/VBoxHeadless</string>
			<string>-startvm</string>
			<string>Windows Vista Ultimate (32-Bit)</string>
		</array>
		<key>RunAtLoad</key>
		<true/>
		<key>HopefullyExitsFirst</key>
		<true/>
		<key>KeepAlive</key>
		<true/>
		<key>UserName</key>
		<string>slauncha</string>
</dict>
</plist>
That's stored as /Library/LaunchDaemons/edu.umich.sites.vm.plist and it runs the VM "Windows Vista Ultimate (32-Bit)" at startup as user slauncha. I haven't tested this on Mac OS X 10.5 Server, but it ought to work.
borgo1971
Posts: 24
Joined: 11. Feb 2009, 18:32
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Windows Server 2003
Location: Italy

Re: running VBox on OS X Server

Post by borgo1971 »

SlaunchaMan wrote:Have you tried using a LaunchDaemon to start the VBoxHeadless process?
Yes, I did. I made plist with Lingon, after that I tried to edit it manually, but...

Code: Select all

		<key>KeepAlive</key>
		<true/>
How do you shutdown your VM with this? Because here's the problem: with KeepAlive set to true, virtualbox starts my VM, but I can't shutdown it, because It will restart evry time it goes down; without KeepAlive, VM won't start. I tried this more times, I tried to go trough a bash script (even with 30sec. delay), but there was nothing to do. I'm running the VM as root user (because with Lingon I was not abel to make the launch.plist run other users deamons), but VM works if launched manually or with KeepAlive option, but not without it.
Way did you use KeepAlive? Can you start the VM without it?
SlaunchaMan
Posts: 65
Joined: 6. Apr 2009, 22:28
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04
Location: Detroit, MI
Contact:

Re: running VBox on OS X Server

Post by SlaunchaMan »

borgo1971 wrote:Why did you use KeepAlive? Can you start the VM without it?
You don't need to use KeepAlive. We're using it so that the VM will automatically restart in the case of failure or user shutdown. If you are using it, however, this command will turn it off and prevent it from starting again (until you reboot):

Code: Select all

/bin/launchctl unload /Library/LaunchDaemons/your.daemon.plist
Replace /Library/LaunchDaemons/your.daemon.plist with your launchd plist, of course.
borgo1971
Posts: 24
Joined: 11. Feb 2009, 18:32
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Windows Server 2003
Location: Italy

Re: running VBox on OS X Server

Post by borgo1971 »

SlaunchaMan wrote: You don't need to use KeepAlive. We're using it so that the VM will automatically restart in the case of failure or user shutdown.
If I don't use KeepAlive, VM doesn't start. I can't understand (for now) way, but it so...
SlaunchaMan wrote: If you are using it, however, this command will turn it off and prevent it from starting again (until you reboot):

Code: Select all

/bin/launchctl unload /Library/LaunchDaemons/your.daemon.plist
Replace /Library/LaunchDaemons/your.daemon.plist with your launchd plist, of course.
This abort's directly my VM, so it's the same I shutdown the Mac directly... :?
I'll try to understand if this strange behavior has something to do with the fact I moved VirtualBox folder to /Library and made symlinks in root and server_admin Librarys. I did so because I can run VM even from server_admin (normally with GUI hypervisor) or as root (with vboxheadless). Now I discovered that I can run vboxheadless also with with launchd as server_admin, I can put VirtualBox back to server_admin Library.
But I guess this will have not much to do with the fact VM doesn't start without KeepAlive :-(
SlaunchaMan
Posts: 65
Joined: 6. Apr 2009, 22:28
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04
Location: Detroit, MI
Contact:

Re: running VBox on OS X Server

Post by SlaunchaMan »

borgo1971 wrote:If I don't use KeepAlive, VM doesn't start. I can't understand (for now) way, but it so...
Try adding this key/value pair:

Code: Select all

<key>RunAtLoad</key>
<true/>
It might be that without the KeepAlive key, there isn't a reason for it to start, so it never does. To test against it, try this: launchctl start your.job.label, where your.job.label is the value of the Label key. If that starts it, then RunAtLoad should do the trick.

For more information, run the command man launchd.plist.
gianbeos
Posts: 1
Joined: 9. Apr 2009, 15:43
Primary OS: Mac OS X Leopard
VBox Version: OSE other
Guest OSses: Windows XP, Ubuntu

Re: running VBox on OS X Server

Post by gianbeos »

borgo1971 wrote:
SlaunchaMan wrote:Have you tried using a LaunchDaemon to start the VBoxHeadless process?
Yes, I did. I made plist with Lingon, after that I tried to edit it manually, but...

Code: Select all

		<key>KeepAlive</key>
		<true/>
How do you shutdown your VM with this? Because here's the problem: with KeepAlive set to true, virtualbox starts my VM, but I can't shutdown it, because It will restart evry time it goes down; without KeepAlive, VM won't start. I tried this more times, I tried to go trough a bash script (even with 30sec. delay), but there was nothing to do. I'm running the VM as root user (because with Lingon I was not abel to make the launch.plist run other users deamons), but VM works if launched manually or with KeepAlive option, but not without it.
Way did you use KeepAlive? Can you start the VM without it?
Try using

Code: Select all

	<key>KeepAlive</key>
	<dict>
		<key>SuccessfulExit</key> 
		<false/>
	</dict>
Launchd restart the Daemons only when exit status is different from 0 (you must manually shutdown the guest)..
borgo1971
Posts: 24
Joined: 11. Feb 2009, 18:32
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Windows Server 2003
Location: Italy

Re: running VBox on OS X Server

Post by borgo1971 »

gianbeos wrote:Try using

Code: Select all

	<key>KeepAlive</key>
	<dict>
		<key>SuccessfulExit</key> 
		<false/>
	</dict>
Launchd restart the Daemons only when exit status is different from 0 (you must manually shutdown the guest)...
Great! That's what I needed! Now it works, VirtualBox starts on Mac startup, and If I need I can shutdown windows. The best is I was there, but I used

Code: Select all

	<key>KeepAlive</key>
	<dict>
		<key>SuccessfulExit</key> 
		<true/>
	</dict>
Now I go to windows guest forum, to know if there's a way to shutdown windows server 2003 without loggin into as administrator... But if someone here knows how to do, I'll listening... :wink:
SlaunchaMan
Posts: 65
Joined: 6. Apr 2009, 22:28
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Ubuntu 18.04
Location: Detroit, MI
Contact:

Re: running VBox on OS X Server

Post by SlaunchaMan »

borgo1971 wrote:Now I go to windows guest forum, to know if there's a way to shutdown windows server 2003 without loggin into as administrator... But if someone here knows how to do, I'll listening... :wink:
I have no idea if it'll work on Windows Server 2003, but there's always psshutdown (Though since Microsoft bought out sysinternals, I don't know if it's readily available).
vbox4me2
Volunteer
Posts: 5218
Joined: 21. Nov 2008, 20:27
Location: Rotterdam
Contact:

Re: running VBox on OS X Server

Post by vbox4me2 »

set RCLNT=192.168.x.y
net use v: \\%RCLNT%\print$ password /user:username /persistent:no
shutdown /s /m \\%RCLNT% /t 10 /c "Shutdown:PowerFailure" /f /d U:6:12
net use v: /delete

Username must be in group(policy) allowed to shutdown server.
borgo1971
Posts: 24
Joined: 11. Feb 2009, 18:32
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Windows Server 2003
Location: Italy

Re: running VBox on OS X Server

Post by borgo1971 »

SlaunchaMan wrote:there's always psshutdown (Though since Microsoft bought out sysinternals, I don't know if it's readily available).
But... it's a windows tool. I want to shutdown Windows Server VM from Mac (we haven't any real PC in our company, only the VM running on our Mac Server)
vbox4me2 wrote:set RCLNT=192.168.x.y
net use v: \\%RCLNT%\print$ password /user:username /persistent:no
shutdown /s /m \\%RCLNT% /t 10 /c "Shutdown:PowerFailure" /f /d U:6:12
net use v: /delete

Username must be in group(policy) allowed to shutdown server.
I think this is a windows script, and needs a windows workstation too. We haven't it!

But if I can't shutdown, thankfully to the windows guest forum, I discovered that I can suspend windows and close vm with

Code: Select all

vboxmanage controlvm my_vm savestate
That can be fine too. But now I'm looking a step forward: I want to automatically shutdown VirtualBox, with the command above, before guest shutdown. I thought it should be easy to make a shutdown script, but for now I wasn't able to find how launch the script.
The script should be launched if ServerMac receives a shutdown command, delaying the ServerMac shutdown the time virtualbox need to save windows state (about 10 sec.).
Post Reply