[VBoxVmService] -> Discussion & Support

Discussions related to using VirtualBox on Windows hosts.
FB2000
Posts: 92
Joined: 10. Sep 2009, 13:27
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: CentOS

Re: [VBoxVmService] -> Discussion & Support

Post by FB2000 »

DWolfman wrote:Is there any way to solve this and have the service actually wait on shutting down until the VM is actually shut down before letting the host continue with it's shutdown? If a solution cannot be found, I'll have to go through setting up some tasks and put a shutdown script in the host OS's group policy to make sure the VM gets shut down cleanly instead.
I noticed Mattz's code read a PauseShutdown parameter and wait for that time before stopping the service. If I understand correct, You could try add

Code: Select all

PauseShutdown=15000
to the [Vm?] section (replace ? with actual VM index) of VBoxVmService.ini, to make sure the computer wait for at least 15 seconds before poweroff.
DWolfman
Posts: 6
Joined: 11. Nov 2009, 07:36
Primary OS: Fedora 16
VBox Version: PUEL
Guest OSses: Windows Server 2008 R2

Re: [VBoxVmService] -> Discussion & Support

Post by DWolfman »

FB2000 wrote:I noticed Mattz's code read a PauseShutdown parameter and wait for that time before stopping the service. If I understand correct, You could try add

Code: Select all

PauseShutdown=15000
to the [Vm?] section (replace ? with actual VM index) of VBoxVmService.ini, to make sure the computer wait for at least 15 seconds before poweroff.
OK, I'll give that a shot.

Thanks
DWolfman
Posts: 6
Joined: 11. Nov 2009, 07:36
Primary OS: Fedora 16
VBox Version: PUEL
Guest OSses: Windows Server 2008 R2

Re: [VBoxVmService] -> Discussion & Support

Post by DWolfman »

OK, the PauseShutdown parameter seems to have fixed it. The desktop under the host (Windows 7) goes away in about the same amount of time, but the "Shutting down..." screen stayed up for longer than it used to. I can live with that. :D

Before restarting Windows 7, I logged into the virtual machine and opened a couple programs, then disconnected my RDP session to the VM, leaving everything open and logged in. The service was set to use the savestate shutdown option. When I got logged back into Windows 7, then brought up an RDP session to my VM and logged in, it came back with the same desktop I had before the shutdown and no prompt for why it didn't shutdown cleanly.

Thanks!
DavidW
Posts: 3
Joined: 17. Nov 2009, 23:26
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, CentOS, Ubuntu

Re: [VBoxVmService] -> Discussion & Support

Post by DavidW »

Hi,

I'm having problems getting VBoxVMService to work properly. I'm running Windows 7 x64 w/ the 3.1.0 BETA release... anyway, I'm getting this error:

ERROR: Could not find a registered machine named 'Ubuntu'
Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown

I have tried several of FB2000's suggestions including running startup.exe 0 BRUTEFORCE from command line. When I take this approach everything works perfectly. I thought maybe the VBOX_USER_HOME environment variable wasn't registered, but have verified it is correct.

Any ideas?
FB2000
Posts: 92
Joined: 10. Sep 2009, 13:27
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: CentOS

Re: [VBoxVmService] -> Discussion & Support

Post by FB2000 »

Hi DavidW,

I've not used 3.1.0 BETA and not sure if this is caused by changes in VirtualBox. There is something else you can check, through:

1. Are you sure be using Mattz's VBoxVmService Release 20091109-win7? This is the only version that recognizes VBOX_USER_HOME variable so far.

If you upgraded from an earlier version, you need to make sure you've uninstalled the old version successfully before you run

Code: Select all

VBoxVmService.exe -i 
again. For both uninstall and install you need Administrator privilege. The tricky thing is under Vista/Windows7, even if you are using Administrator account, you still need to right click the Command Prompt icon, and select "Run as Administrator..." to really get Administrator privilege. And you should always check VBoxVmService.log to see if your install/uninstall succeeded.

2. What if you set the VBOX_USER_HOME variable manually as system environment variable?

3. How do you verify that VBOX_USER_HOME is correct? For me if I type "set" in command prompt I can't see VBOX_USER_HOME listed. Because the variable is registered as LocalService user and not visible by my normal account.

Best regards, FB2000
DavidW
Posts: 3
Joined: 17. Nov 2009, 23:26
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, CentOS, Ubuntu

Re: [VBoxVmService] -> Discussion & Support

Post by DavidW »

Thanks FB2000,

1. Yep... installed the 11/9 release of VBoxVmService (no prior installs). Originally I had run into that same Admin problem you mentioned... but eventually got the service installed.
2. For me at least, when I run the service, it added the VBOX_USER variable to User Variables not System. I did try creating a System Variable, and this too did not help.
3. Just for kicks, I also tried copying my VirtualBox.xml file to System32... still nothin'

Based on the fact it's working w/ startup.exe, it seems like the problem lies in how VBoxVmService is interacting with the environment variable.
DavidW
Posts: 3
Joined: 17. Nov 2009, 23:26
Primary OS: Mac OS X Leopard
VBox Version: PUEL
Guest OSses: Windows XP, Windows 7, CentOS, Ubuntu

Re: [VBoxVmService] -> Discussion & Support

Post by DavidW »

Ok, so one little step I forgot... reboot the machine! With system variables, they are not loaded simply by logging off and back on. So... everything is now working.

1. Install required dependencies
2. Download and unzip the 1109 release of VBoxVmService to c:\vms
3. Right-click cmd > Runas Administrator
4. c:\vms\VBoxVmService.exe -i
5. Configure the .ini
**6. Manually create a system variable matching what was in the .ini
7. Reboot :)

One question I had is if on step #1, the Windows 2003 tools are still necessary?

Thanks again FB2000 for your help!
FB2000
Posts: 92
Joined: 10. Sep 2009, 13:27
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: CentOS

Re: [VBoxVmService] -> Discussion & Support

Post by FB2000 »

Hi DavidW,

Glad to know it worked after reboot! I never thought that could be a problem. :D

To answer you question, you could skip step #1 since everything needed is already in Windows7. Step #6 is also not necessary since the variable is already set in VBoxVmService.ini (and should be working alone).

And now I understand why VBOX_USER_HOME shows up in your User Variables, it's because you've run startup.exe manually. That will normally get the variable written into current user's environment variable. It's not used by VBoxVmService system service anyway.

Regards, FB2000
karazy
Posts: 5
Joined: 9. Dec 2009, 03:48
Primary OS: MS Windows 7
VBox Version: OSE other
Guest OSses: Windows 7

Re: [VBoxVmService] -> Discussion & Support

Post by karazy »

The seems to be small bug in rel20091109 with Virtualbox 3.1.0

It seems the startup.bat file uses the flag -vrdpport instead of --vrdpport.

I have changed the startup.bat file in the src directory. How do I recompile and use the new bat file in the service.

Here is the error in my log files

Code: Select all


Using custom VRDP-Port: 3001 
VirtualBox Command Line Management Interface Version 3.1.0
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

Usage:

VBoxManage modifyvm         <uuid|name>
                            [--name <name>]
                            [--ostype <ostype>]
                            [--memory <memorysize in MB>]
                            [--vram <vramsize in MB>]
                            [--acpi on|off]
                            [--ioapic on|off]
                            [--pae on|off]
                            [--hwvirtex on|off]
                            [--nestedpaging on|off]
                            [--vtxvpid on|off]
                            [--cpuidset <leaf> <eax> <ebx> <ecx> <edx>]
                            [--cpuidremove <leaf>]
                            [--cpuidremoveall]
                            [--cpus <number>]
                            [--monitorcount <number>]
                            [--accelerate3d <on|off>]
                            [--accelerate2dvideo <on|off>]
                            [--firmware bios|efi|efi32|efi64]
                            [--bioslogofadein on|off]
                            [--bioslogofadeout on|off]
                            [--bioslogodisplaytime <msec>]
                            [--bioslogoimagepath <imagepath>]
                            [--biosbootmenu disabled|menuonly|messageandmenu]
                            [--biossystemtimeoffset <msec>]
                            [--biospxedebug on|off]
                            [--boot<1-4> none|floppy|dvd|disk|net>]
                            [--nic<1-N> none|null|nat|bridged|intnet|hostonly]
                            [--nictype<1-N> Am79C970A|Am79C973|
                                            82540EM|82543GC|82545EM|
                                            virtio]
                            [--cableconnected<1-N> on|off]
                            [--nictrace<1-N> on|off]
                            [--nictracefile<1-N> <filename>]
                            [--nicspeed<1-N> <kbps>]
                            [--bridgeadapter<1-N> none|<devicename>]
                            [--hostonlyadapter<1-N> none|<devicename>]
                            [--intnet<1-N> <network name>]
                            [--natnet<1-N> <network>|default]
                            [--macaddress<1-N> auto|<mac>]
                            [--uart<1-N> off|<I/O base> <IRQ>]
                            [--uartmode<1-N> disconnected|
                                             server <pipe>|
                                             client <pipe>|
                                             file <file>|
                                             <devicename>]
                            [--gueststatisticsinterval <seconds>]
                            [--audio none|null|dsound]
                            [--audiocontroller ac97|sb16]
                            [--clipboard disabled|hosttoguest|guesttohost|
                                         bidirectional]
                            [--vrdp on|off]
                            [--vrdpport default|<ports>]
                            [--vrdpaddress <host>]
                            [--vrdpauthtype null|external|guest]
                            [--vrdpmulticon on|off]
                            [--vrdpreusecon on|off]
                            [--usb on|off]
                            [--usbehci on|off]
                            [--snapshotfolder default|<path>]
                            [--teleporter on|off]
                            [--teleporterport <port>]
                            [--teleporteraddress <address|empty>
                            [--teleporterpassword <password>]
                            [--hardwareuuid <uuid>]

error: unknown option: -vrdpport
mattz
Posts: 95
Joined: 18. Feb 2008, 11:51
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: WinXP/Debian/OSX
Location: Germany
Contact:

Re: [VBoxVmService] -> Discussion & Support

Post by mattz »

This is due to a change of parameter acceptance changes in Virtualbox 3.1.0 and has already been pointed out to me by FB2000.

The just released version 20091210-win7 fixes this issue. See: http://forums.virtualbox.org/viewtopic. ... 94#p114894
Tronder
Posts: 4
Joined: 17. Dec 2009, 20:26
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Linux Ubuntu 9.10 x64

Re: [VBoxVmService] -> Discussion & Support

Post by Tronder »

Thanks for a great product and a great support forum.

I carefully installed the program according to instructions (Windows 7 Host, Ubuntu 9.10 Guest). The startup 0 BRUTEFORCE works great from the DOS command line (the lockfile in the run folder appears, I can ssh into the headless Ubuntu VM from a different machine). shutdown 0 works as expected as well. lock, run, tmp folders empty. I install as a system service, according to instructions, and start the system service (starts "Automatically").

I ensure the system service is "Running". I reboot the Win 7 host machine and try to ssh into Ubuntu from a different computer - no luck. I log into the Win 7 machine and check the logfile (attached below,... I cleared it before the Win 7 reboot, so these entries are all relevant). There are Errors... Somehow it does not find Ubuntu when starting as a system service. I notice that there is a lockfile in the run directory. And the Service is indeed "Running".

Any idea why it cannot find a registered machine named 'ubuntu'? I'm more familiar with Linux system services than Windows services... do I need to set the "Log On" tab in the "Properties" dialog for the system service in some specific way? Permissions issue?

Stumped.

T.

Code: Select all

[Settings]
ServiceName=VBoxVmService
PathToVBoxSDL=C:\Program Files\Sun\VirtualBox\VBoxSDL.exe
PathToVBoxHeadless=C:\Program Files\Sun\VirtualBox\VBoxHeadless.exe
PathToVBoxManage=C:\Program Files\Sun\VirtualBox\VBoxManage.exe
VBOX_USER_HOME=C:\Users\Tronder\.VirtualBox
[Vm0]
VmName=ubuntu
CommandLineUp=c:\vms\startup.exe 0 BRUTEFORCE
CommandLineDown=c:\vms\shutdown.exe 0
WorkingDir=C:\vms
StartupMethod=vrdp
ShutdownMethod=savestate
VrdpPort=3001

Code: Select all

This VM does not seem to be currently running. Shutdown call aborted. 
12/17/2009, 11:19:06 - c:\vms\VBoxVmService.exe
12/17/2009, 11:19:06 - c:\vms\VBoxVmService.ini
12/17/2009, 11:19:06 - c:\vms\VBoxVmService.log
12/17/2009, 11:19:06 - VBoxVmService
BRUTEFORCE: Killing all existing run- / lockfiles for this VM...  
No previously started VM operations to wait for. Continuing... 
Reading global parameters... 
Setting VBOX_USER_HOME within the machine environment... 
Reading parameters for VM0... 
VirtualBox Command Line Management Interface Version 3.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

ERROR: Could not find a registered machine named 'ubuntu'
Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown
Context: "FindMachine (Bstr(VMNameOrUuid), machine.asOutParam())" at line 2017 of file VBoxManageInfo.cpp
Using custom VRDP-Port: 3001 
VirtualBox Command Line Management Interface Version 3.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

ERROR: Could not find a registered machine named 'ubuntu'
Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown
Context: "FindMachine(Bstr(a->argv[0]), machine.asOutParam())" at line 251 of file VBoxManageModifyVM.cpp
VirtualBox Command Line Management Interface Version 3.1.2
(C) 2005-2009 Sun Microsystems, Inc.
All rights reserved.

ERROR: Could not find a registered machine named 'ubuntu'
Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBox, interface IVirtualBox, callee IUnknown
Context: "FindMachine(Bstr(VMName), machine.asOutParam())" at line 357 of file VBoxManageMisc.cpp
Starting VM: "ubuntu" via vrdp as a service ... 
Moving lockfile: STARTUP to RUN  
Tronder
Posts: 4
Joined: 17. Dec 2009, 20:26
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Linux Ubuntu 9.10 x64

Re: [VBoxVmService] -> Discussion & Support

Post by Tronder »

Sorry to respond to my own question. I found the solution - just run this command (edit the user name of course) and reboot:

Code: Select all

copy c:\Users\Tronder\.VirtualBox\VirtualBox.xml C:\Windows\System32\config\Systemprofile\.VirtualBox
The reason I didn't try that before was that I thought this step was no longer necessary in the latest revision of VBoxVmService.

I suspect this is what solved it for DavidW further up on the page. I never believed in his System Variable & reboot solution :wink:

T.
FB2000
Posts: 92
Joined: 10. Sep 2009, 13:27
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: CentOS

Re: [VBoxVmService] -> Discussion & Support

Post by FB2000 »

Tronder wrote:Sorry to respond to my own question. I found the solution - just run this command (edit the user name of course) and reboot:

Code: Select all

copy c:\Users\Tronder\.VirtualBox\VirtualBox.xml C:\Windows\System32\config\Systemprofile\.VirtualBox
Just to clarify that I don't need to copy VirtualBox.xml to get VBoxVmService work on my Win7 host. In fact I have deleted the whole C:\Windows\System32\config\Systemprofile\.VirtualBox folder after switching to VBOX_USER_HOME solution.

The default installation of VBoxVmService should have set the service to be run as Local SYSTEM account. If somehow it get changed to Local Service account, or if c:\Users\Tronder\.VirtualBox folder can't be accessed by SYSTEM account, then you'll have to hardlink/copy the config file.
Tronder
Posts: 4
Joined: 17. Dec 2009, 20:26
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Linux Ubuntu 9.10 x64

Re: [VBoxVmService] -> Discussion & Support

Post by Tronder »

Thanks, FB2000.... great info.

Maybe not the topic of this forum, but I wonder if there is a way to hook into port 3001 and run an Ubuntu Terminal screen on the Windows desktop... When I use the Microsoft mstsc.exe, I get the entire Ubuntu desktop up onto my Windows desktop (which is a bit of an overkill). I think what I need is "seamless mode", and that mstsc.exe does not support it. Oh well.
TerryE
Volunteer
Posts: 3572
Joined: 28. May 2008, 08:40
Primary OS: Ubuntu other
VBox Version: PUEL
Guest OSses: Ubuntu 10.04 & 11.10, both Svr&Wstn, Debian, CentOS
Contact:

Re: [VBoxVmService] -> Discussion & Support

Post by TerryE »

Tronder wrote:I wonder if there is a way to hook into port 3001 and run an Ubuntu Terminal screen on the Windows desktop...
If you want to run a std terminal window in Windows, then install PuTTY on your host and ssh-server on your Ubuntu VM. You can then run as many terminal sessions as you want over SSH. That's how I usually talk to my VMs. You can do the same with X applications using GNU Xterm but it is a bit more convolved to set up.
Read the Forum Posting Guide
Google your Q site:VirtualBox.org or search for the answer before posting.
Post Reply