Page 1 of 1

Start / Manage VMs from Windows 7 telnet server

Posted: 11. Aug 2010, 02:56
by MattT
I'm using VirtualBox 3.2.8 on Windows 7 Pro 64bit (EM64T) and am trying to login to the Windows 7 host via Windows telnet and then start or manage VirtualBox VMs that way.

This is so I can start VMs remotely.

However I can't even seem to list my current VMs.

Note: There is another user logged in graphically when I try this.

Is this possible ?
I'd prefer not to have to keep the VMs running as a service all the time.

*===============================================================
Microsoft Telnet Server.
*===============================================================
C:\Users\Matt>"C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list vms
Oracle VM VirtualBox Command Line Management Interface Version 3.2.8
(C) 2005-2010 Oracle Corporation
All rights reserved.

ERROR: failed to create the VirtualBox object!
ERROR: Could not create the VirtualBox home directory '' (VERR_PATH_NOT_FOUND)
Details: code E_FAIL (0x80004005), component VirtualBox, interface IVirtualBox,
callee

Re: Start / Manage VMs from Windows 7 telnet server

Posted: 11. Aug 2010, 03:02
by Perryg
See Chapter 9.1. VirtualBox configuration data in your VirtualBox users guide.

Re: Start / Manage VMs from Windows 7 telnet server

Posted: 11. Aug 2010, 05:17
by MattT
Perryg,

I typically use VirtualBox under the graphical Windows 7 shell and that is how I've set up all my VMs.
Are you saying that I will need to set some Windows environment variables to access my VirtualBox configuration ?
If this is the case, I'm wondering why a login via the Windows 7 telnet server does not already have my standard environment variables set.
Or are you just saying that I need to add the VirtualBox installation directory to my command search path ?

When logged in via the telnet server, the following environment variables are set:

ALLUSERSPROFILE=C:\ProgramData
APPDATA=C:\Users\Matt\AppData\Roaming
asl.log=Destination=file;OnFirstLog=command,environment
CLASSPATH=.;C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
CommonProgramFiles=C:\Program Files\Common Files
CommonProgramFiles(x86)=C:\Program Files (x86)\Common Files
CommonProgramW6432=C:\Program Files\Common Files
COMPUTERNAME=VENUS
ComSpec=C:\Windows\system32\cmd.exe
FP_NO_HOST_CHECK=NO
HOMEDRIVE=C:
HOMEPATH=\Users\Matt
NUMBER_OF_PROCESSORS=8
OS=Windows_NT
Path=C:\Program Files (x86)\PC Connectivity Solution\;C:\Windows\system32;C:\Win
dows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Pro
gram Files (x86)\ATI Technologies\ATI.ACE\Core-Static;C:\Program Files (x86)\Qui
ckTime\QTSystem\
PATHEXT=.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC
PROCESSOR_ARCHITECTURE=AMD64
PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 30 Stepping 5, GenuineIntel
PROCESSOR_LEVEL=6
PROCESSOR_REVISION=1e05
ProgramData=C:\ProgramData
ProgramFiles=C:\Program Files
ProgramFiles(x86)=C:\Program Files (x86)
ProgramW6432=C:\Program Files
PROMPT=$P$G
PSModulePath=C:\Windows\system32\WindowsPowerShell\v1.0\Modules\
PUBLIC=C:\Users\Public
QTJAVA=C:\Program Files (x86)\Java\jre6\lib\ext\QTJava.zip
SystemDrive=C:
SystemRoot=C:\Windows
TEMP=C:\Windows\TEMP
TERM=ansi
TMP=C:\Windows\TEMP
USERDOMAIN=Venus
USERNAME=matt
USERPROFILE=C:\Users\Matt
VBOX_INSTALL_PATH=C:\Program Files\Oracle\VirtualBox\
windir=C:\Windows

Re: Start / Manage VMs from Windows 7 telnet server

Posted: 11. Aug 2010, 08:12
by MattT
I'm not sure that I have clearly described my setup. It is:

Hosting O.S.: Windows 7 Pro 64bit (Core i7-860 EM64T 8GB RAM).
VirtualBox 3.2.8 running various Linux/UNIX guest VMs which I've installed using the standard VirtualBox GUI.

I now want to be able to log into the physical host (Windows 7) from a remote location and be able to start / stop / manage VMs.
I've installed the Windows 7 telnet server and enabled the service.
I've added my standard user to the appropriate group so that I can log in to the telnet server.
I then try to run VBoxManage list vms and get the error:

ERROR: failed to create the VirtualBox object!
ERROR: Could not create the VirtualBox home directory '' (VERR_PATH_NOT_FOUND)
Details: code E_FAIL (0x80004005), component VirtualBox, interface IVirtualBox,
callee

Note that the character that looks like a double quote after the text "Could not create the VirtualBox home directory" is actually two single quotes.
So VBox thinks that the VirtualBox home directory is an empty string even though the HOMEDRIVE and HOMEPATH environment variables are set.
I've looked at the documentation that "Perryg" has pointed to and have tried setting the VBOX_USER_HOME environment variable but this has not helped (I still get the same error).
I've even tried adding the "C:\Program Files\Oracle\VirtualBox" directory to my Path but this also does not help.

"C:\Program Files\Oracle\VirtualBox\VBoxManage" by itself does run and tells me it's usage.

Please help.

Re: Start / Manage VMs from Windows 7 telnet server

Posted: 11. Aug 2010, 14:47
by MattT
I've now tested when I'm logged in to the Windows 7 GUI and still have the same problem.
Running "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list vms from a "cmd.exe" prompt works OK but runnning it from a Windows 7 telnet server session gives the error I mention.
The environment variables in each are identical (except that TERM is also set in the Windows 7 telnet server session).

So, Windows 7 telnet session is different from a "cmd.exe" session.

I've also tested running a "cmd.exe" from the Windows 7 telnet session and then running "C:\Program Files\Oracle\VirtualBox\VBoxManage.exe" list vms from there but I still get the same error.

Re: Start / Manage VMs from Windows 7 telnet server

Posted: 11. Aug 2010, 18:35
by Perryg
Well MattT
I just tried this as well and while I can get everything to work as it should nothing happens. I suspect that telnet is not working due to it running as a service and not the actual user but can not tell at this point what to do. I do know that you can not use telnet to start a GUI program, but thought you could run a batch file to start and stop the service. Only problem with that is you would need to stop the UAC in Windows 7 for sure and then be able to tell VBox that the service can start the process, and I have not figured out how to do that yet.

Re: Start / Manage VMs from Windows 7 telnet server

Posted: 12. Aug 2010, 13:55
by MattT
Perryg,

Are you saying that you can get VBoxManage to list your VMs ?
I cannot no matter what I try.
On the assumption that VirtualBox may require Administrator privileges I have no allowed this using the procedure at: http://technet.microsoft.com/en-us/libr ... 10%29.aspx
But I still get the same result.

Please confirm exactly what you have been able to achieve.

P.S. I know I can't run a GUI, my intention is to use VBoxHeadless... but I can't even use VBoxManage yet!

Re: Start / Manage VMs from Windows 7 telnet server

Posted: 21. Aug 2010, 04:03
by MattT
Perryg,

You didn't answer my last question to you on this topic.
I would really like to know what you meant when you said: "and while I can get everything to work as it should nothing happens".

I suppose by "thought you could run a batch file to start and stop the service" you are talking about a VirtualBox service. I didn't want to go down this path, I just want to use VBoxManage as my user to start or manage any Virtual Machine.

As for "Only problem with that is you would need to stop the UAC in Windows 7 for sure and then be able to tell VBox that the service can start the process, and I have not figured out how to do that yet.", I was not wanting to stop UAC. Are you saying that I need to for some reason ?

What you seem to be saying is that the problem is due to the telnet service running as "Local Service" and not me so even though I think I'm using my credentials I'm not really ? So is there a way to truely become myself ? Would I need an AD domain and to authenticate to the telnet service using NTLM maybe ? All things are possible, I'm just not sure what is the way forward.

Re: Start / Manage VMs from Windows 7 telnet server

Posted: 22. May 2011, 20:40
by Sopalajo de Arrierez
I have similar problem here :(
I have no output when I do "vboxmanage list vms" in Windows XP.

Code: Select all

C:\Oracle\VirtualBox>VBoxManage list vms

C:\Oracle\VirtualBox>
I have this in my SET variables stuff:

Code: Select all

VBOX_INSTALL_PATH=C:\Oracle\VirtualBox\
I do login with correct user, of course. And I tried this, too:

Code: Select all

set VBOX_USER_HOME="c:\Oracle\VirtualBox\";"d:\VirtualBox VMs\";"C:\WINDOWS\system32\config\systemprofile\VirtualBox VMs"
set path=%path%;c:\Oracle\VirtualBox
Is this a bug of VirtualBox? I have the same results connecting via Telnet or SSH (using Bitvise WinSSHD).
Help, please :|

Re: Start / Manage VMs from Windows 7 telnet server

Posted: 4. Jun 2011, 14:39
by Sopalajo de Arrierez
All right. Now the "list vms" issue is solved :D . It was just a matter of add this environment variable:

Code: Select all

VBOX_USER_HOME "c:\Documents and Settings\Usuario\.VirtualBox"
C:\Oracle\VirtualBox>VBoxManage.exe list vms
"BackTrack Linux v4 R2" {b157c843-bd59-44fc-8702-8c88ad0dc732}
Now my VMs are listable and running, in fact :) . But I can not add usb devices. This is my output when connecting via telnet:
C:\Oracle\VirtualBox>VBoxManage.exe list usbhost
Host USB Devices:

<none>
but, if I write in local console:
C:\Oracle\VirtualBox>VBoxManage.exe list usbhost
Host USB Devices:

UUID: a372eebe-f143-42ac-8da8-b89c6680689f
VendorId: 0x07d1 (07D1)
ProductId: 0x3c03 (3C03)
Revision: 0.1 (0001)
Manufacturer: Ralink
Product: 802.11 bg WLAN
Current State: Available
What do you think?

Re: Start / Manage VMs from Windows 7 telnet server

Posted: 22. Aug 2012, 02:18
by JasonC
My solution to using Windows 7 telnet server to administer VirtualBox was to modify the properties of the TELNET SERVER service to LogOn as LocalSystem as well as some other privilege changes to the service.

I used the following article from Microsoft Technet as my guide:
Configure Telnet Server to Allow Administrator Access by using Password Authentication
This is my first post here, so I cannot post links.
Google search for technet cc754102

I followed the instructions on that page under this heading:
To use the Local System security account to run Telnet

My environment variables only include VBOX_INSTALL_PATH.

CAVEAT: If I close the telnet session, my guests are taken down.

I start a vm using:
vboxmanager startvm MyVMName --type headless

I am using VirtualBox 4.1.20 r80170 on Win7/x86-64.

Cheers,
Jason