Jump to content

Recommended Posts

Posted

What are you trying to do with the fact you already have a snapshot enabled when you're trying to import it etc? If you did a clone of the VM you'll probably have old references included in the XML of the VM and it'll not like that if the GUIDS change or you're not copying all the files.

 

if you look within the XML file does it show the Win7 machine still?

 

Also the last errors are because you're missing the quotes on the last line so sending two seperate commands

 

Steve

  • Thanks 1
Posted
What are you trying to do with the fact you already have a snapshot enabled when you're trying to import it etc? If you did a clone of the VM you'll probably have old references included in the XML of the VM and it'll not like that if the GUIDS change or you're not copying all the files.

 

if you look within the XML file does it show the Win7 machine still?

 

Also the last errors are because you're missing the quotes on the last line so sending two seperate commands

 

Steve

 

I'm sorry but I don't understand what you mean by already have a snapshot enabled. What I've done is created the VM and set as I needed it and then took a snapshot. The snapshot is then refereed to in the script. Is this not how it's suppose to be?

 

Could you please highlight where I'm missing the quotes?

 

Thank you

Manny

Posted

Autoreset is designed for Immutable disks that will remove all changes at restart by default. If you're creating a snapshot over the disk you're removing the immutable flags as it'll be saved as a snapshot over the top.

 

Did you change your original disk type from normal to immutable in the first place or are you just basing the reset on a snapshot? If so they can still revert and remove the snapshots that are over the top by modifying the original disk or creating a snapshot over the top.

 

In regards to the last line they're supposed to be like your first one, but on the last one you're missing the quotes at the end

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" startvm C:\ProgramData\VirtualBox VMs\Lubuntu\Lubuntu.vdi", 1 

 

should be like (without testing)

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" startvm ""C:\ProgramData\VirtualBox VMs\Lubuntu\Lubuntu.vdi""", 1 

 

As you're currently passing on two commands to start

startvm C:\ProgramData\VirtualBox VMs\Lubuntu\Lubuntu.vdi

Like that effectively

 

Steve

  • Thanks 1
Posted
How do I make the disk immutable? I de-attached the disk from the VM and looked in the Virtual Media Manager and can't find an option to make it immutable?
Posted

So, riddle me this. I have managed to figure out how to immute the disk and it works (looses all changes made).

 

I then created a shortcut to the VM straight to the desktop. Clicking on the shortcut works and it launches the VM.

 

When I logon on to the using a test user and click on the shortcut to launch the VM, I get this error. The virtual machine is deffo there, I checked, yet it complains it can't find it?

 

XP Error.JPG

Posted

If you imported it as one user it's not going to show for another user. You need to run the register one per user (or modify the shared virtualbox path for all users to the same place if I remember it was VBOX_USER_HOME else by default its user profile based)

 

The other option as a quick test would be use the VM name not GUID to try to start it

 

Steve

  • Thanks 1
Posted
If you imported it as one user it's not going to show for another user. You need to run the register one per user (or modify the shared virtualbox path for all users to the same place if I remember it was VBOX_USER_HOME else by default its user profile based)

 

The other option as a quick test would be use the VM name not GUID to try to start it

 

Steve

 

I haven't actually imported/moved the VM, it's still on the computer that it was created on. I just logged on to the computer using a different user account (test). Where/how do I change the VBOX_USER_HOME?

 

Thanks

Posted
Try adding:

VBoxManage.exe setproperty machinefolder "C:\ProgramData\VirtualBox VMs"

at the top of your script.

 

Thanks man, but it's still the same. I feel I'm so close to achieving this but something small is stopping it.

Posted

I have tried each command one at a time using cmd prompt.

 

These are the only 3 commands I've ran:

 

This one ran without an issue (as in no errors)

c:\Program Files\Oracle\VirtualBox>vboxmanage.exe setproperty machinefolder "C:\ProgramData\VirtualBox VMs"

 

This one ran without an issue (as in no errors)

c:\Program Files\Oracle\VirtualBox>vboxmanage.exe registervm "C:\ProgramData\VirtualBox VMs\XP\XP.vbox"

 

This one errored with the following message:

c:\Program Files\Oracle\VirtualBox>vboxmanage.exe startvm "C:\ProgramData\VirtualBox VMs\XP\XP.vdi"

 

VBoxManage.exe: error: Could not find a registered machine named 'C:\ProgramData\VirtualBox VMs\XP\XP.vdi'

VBoxManage.exe: error: Details: code VBOX_E_OBJECT_NOT_FOUND (0x80bb0001), component VirtualBoxWrap, interface IVirtualBox, callee IUnknown

VBoxManage.exe: error: Context: "FindMachine(Bstr(pszVM).raw(), machine.asOutParam())" at line 595 of file VBoxManageMisc.cpp

 

The The VBoxSVC log file reports the following, being consistent with the above mentioned commands that I ran.

VirtualBox COM Server 5.2.6 r120293 win.amd64 (Jan 15 2018 14:58:38) release log

00:00:00.000000 main Log opened 2018-02-20T13:35:43.561618300Z

00:00:00.000000 main Build Type: release

00:00:00.000000 main OS Product: Windows 8.1

00:00:00.000000 main OS Release: 6.3.9600

00:00:00.000000 main OS Service Pack:

00:00:00.000000 main DMI Product Name: MS-7817

00:00:00.015626 main DMI Product Version: 1.0

00:00:00.015626 main Host RAM: 8069MB (7.8GB) total, 6622MB (6.4GB) available

00:00:00.015626 main Executable: c:\Program Files\Oracle\VirtualBox\VBoxSVC.exe

00:00:00.015626 main Process ID: 3104

00:00:00.015626 main Package type: WINDOWS_64BITS_GENERIC

00:00:00.015626 VirtualBox: object creation starts

00:00:00.015626 Home directory: 'C:\Users\msingh\.VirtualBox'

00:00:00.015626 Installed Drivers:

00:00:00.015626 C:\windows\system32\DRIVERS\VBoxNetLwf.sys (Version: 5.2.6.20293)

00:00:00.015626 C:\windows\system32\DRIVERS\VBoxUSBMon.sys (Version: 5.2.6.20293)

00:00:00.015626 C:\windows\system32\DRIVERS\VBoxDrv.sys (Version: 5.2.6.20293)

00:00:00.015626 C:\windows\system32\DRIVERS\VBoxNetAdp6.sys (Version: 5.2.6.20293)

00:00:00.015626 Loading settings file "C:\Users\msingh\.VirtualBox\VirtualBox.xml" with version "1.12-windows"

00:00:00.188313 HostDnsMonitor: old information

00:00:00.188313 no server entries

00:00:00.188313 no domain set

00:00:00.188313 no search string entries

00:00:00.188313 HostDnsMonitor: new information

00:00:00.188313 server 1: 10.88.160.21

00:00:00.188313 server 2: 10.88.0.21

00:00:00.188313 domain: school

00:00:00.188313 no search string entries

00:00:00.188313 HostDnsMonitorProxy::notify

00:00:00.236018 VD: VDInit finished with VINF_SUCCESS

00:00:00.237017 Loading settings file "C:\ProgramData\VirtualBox VMs\XP\XP.vbox" with version "1.15-windows"

00:00:00.237518 VirtualBox: object created

00:00:00.239009 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'C:\ProgramData\VirtualBox VMs\XP\XP.vdi'}, preserve=false aResultDetail=0

00:00:05.254991 main VirtualBox: object deletion starts

00:00:05.254991 Watcher ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={The object is not ready}, preserve=false aResultDetail=0

00:00:05.254991 main VirtualBox: object deleted

 

I think I'm getting a little closer now. Is it that it's not registering the VM, despite the fact I have ran the registervm command successfully?

 

Thanks again.

Manny

Posted
One is vbox and one is vdi :p Which did you mean?

 

Steve

 

Thanks for pointing that out. changing it to bvox has worked a treat. So happy that it finally launches the VM.

 

On to the final problem (hopefully). So the issue is now with the commands to lock down the VM. The log shows the following:

00:00:00.186484 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'XP'}, preserve=false aResultDetail=0

00:00:00.186484 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'XP'}, preserve=false aResultDetail=0

00:00:00.186484 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'XP'}, preserve=false aResultDetail=0

00:00:00.186484 Saving settings file "C:\Users\msingh\.VirtualBox\VirtualBox.xml" with version "1.12-windows"

00:00:00.186484 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'C:\ProgramData\VirtualBox'}, preserve=false aResultDetail=0

00:00:00.186484 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'VMs\XP\XP.vbox'}, preserve=false aResultDetail=0

 

So like before, am I going wrong with syntax somewhere?

 

Thanks

Manny

Posted

Right then, the following commands are working, when ran one by one.

 

cmd.jpg

 

The exact commands ran from a script:

 

Dim objShell

Set objShell = CreateObject("WScript.Shell")

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" setproperty machinefolder C:\ProgramData\VirtualBox VMs""", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" registervm ""C:\ProgramData\VirtualBox VMs\XP\XP.vbox""", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" startvm C:\ProgramData\VirtualBox VMs\XP\XP.vbox""", 1

 

Getting this error:

 

00:00:00.252191 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'C:\ProgramData\VirtualBox'}, preserve=false aResultDetail=0

00:00:00.252691 Loading settings file "C:\ProgramData\VirtualBox VMs\XP\XP.vbox" with version "1.15-windows"

00:00:00.253210 Saving settings file "C:\Users\msingh\.VirtualBox\VirtualBox.xml" with version "1.12-windows"

00:00:00.255473 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'VMs\XP\XP.vbox'}, preserve=false aResultDetail=0

 

How can it error when using the script and completely happy when ran manually?

Posted

Because you're last line is still wrong with speech marks as per my other post :p

 

Check the last line compared to the other we were talking about with Win7 and look at the quotations (the first is wrong on this XP one too)

 

Steve

Posted

I've abandoned the vbscript and come back to batch file and it's still not happy :(

 

Three simple commands, again fine running mannually.

 

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setproperty machinefolder "C:\ProgramData\VirtualBox VMs"

 

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" registervm "C:\ProgramData\VirtualBox VMs\XP\XP.vbox"

 

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" startvm "c:\programdata\virtualbox vms\xp\xp.vbox"

 

Run as a bath file and I'm back to crying.

 

00:00:00.252480 VirtualBox: object created

00:00:00.254482 Saving settings file "C:\Users\msingh\.VirtualBox\VirtualBox.xml" with version "1.12-windows"

00:00:00.254482 ERROR [COM]: aRC=VBOX_E_OBJECT_NOT_FOUND (0x80bb0001) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={Could not find a registered machine named 'c:\programdata\virtualbox vms\xp\xp.vbox'}, preserve=false aResultDetail=0

00:00:00.254482 Loading settings file "C:\ProgramData\VirtualBox VMs\XP\XP.vbox" with version "1.15-windows"

00:00:00.259487 Saving settings file "C:\Users\msingh\.VirtualBox\VirtualBox.xml" with version "1.12-windows"

00:00:05.266064 main VirtualBox: object deletion starts

00:00:05.266064 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={4afe423b-43e0-e9d0-82e8-ceb307940dda} aComponent={MediumWrap} aText={Medium 'C:\ProgramData\VirtualBox VMs\XP\Snapshots/{6e2b445b-08c8-4149-96ea-0a089d0c7a80}.vdi' cannot be closed because it is still attached to 1 virtual machines}, preserve=false aResultDetail=0

00:00:05.267062 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={4afe423b-43e0-e9d0-82e8-ceb307940dda} aComponent={MediumWrap} aText={Cannot close medium 'C:\ProgramData\VirtualBox VMs\XP\XP.vdi' because it has 1 child media}, preserve=false aResultDetail=0

00:00:05.272464 Watcher ERROR [COM]: aRC=E_ACCESSDENIED (0x80070005) aIID={9570b9d5-f1a1-448a-10c5-e12f5285adad} aComponent={VirtualBoxWrap} aText={The object is not ready}, preserve=false aResultDetail=0

00:00:05.273469 main VirtualBox: object deleted

 

For those of you that it's working (and has been for years), are you on the latest version of Virtualbox or you're still on the version you started off with? I'm wondering if it's actually a bug in VirtualBox.....

Posted

Right then, an update. All those different errors about can't find the VM and various access denied stuff, well if I run the batch file as different user (administrator), it finally starts working.

 

RunAs.jpg

 

So, it's a permissions issue. How the heck do I build that into the script? I'm surprised no one else had this issue? Any ideas anywhere?

 

Thanks Again.

Posted

You really should have a read through the other threads on here, there's loads about setting this up and answering most of this :p

 

You're gonna have issues using ProgramData because it's a UAC area. Most people are using a local C drive folder that they're giving permissions to write to to be able to edit the VMs etc. Don't use somewhere UAC prompts and you won't need to run as admin etc

 

Steve

  • Thanks 1
Posted

I have finally come across a very nice and detailed doc to get me through this. The batch file file works brilliantly and I've even managed to attach a Shared Folder (N:) to the users own home drive.

 

Next question, how can I make sure that USB storage attached to Host is also accessible to Guest? At the moment when Guest is running, it picks non of the Host attached USB storage.

 

Thanks

Manny

Posted

Just wanted to say Thank You to everyone that contributed to this thread. The VM is now with the teacher to test and should be ready to roll out soon.

 

Cheers.

Manny

Posted

Good to hear. Sorry I haven't been able to provide more personal input, things have been strained here to say the least!

Never got as far as USB storage passthrough, but if you're still struggling I vaguelly recall it requiring something being enabled in the bios of the host computer - may have been VTx-d or similar.

  • Thanks 1
Posted

If you create a filter for the USB devices they'll auto mount and passthrough as soon as the host finds them, if you're talking like any random USB stick etc you'd need to use onthefly mapping or allow the gui to select the mount options (obviously removing some of the lockdowns)

 

But really there's no need to allow USB devices on the machines normally, if it's something like a tablet for gaming you can do the filter, and if it's for files you can copy through shared folders

 

Steve

  • Thanks 1
Posted

Well I've tested saving files to/from the mapped users home directory, so probably abandon the USB route (for now).

 

Thanks again.

Posted

Oh no, I'm back for more. The teacher has done some testing with Visual Studio and has hit a snag when creating a new ASP.Net Web Application project. Trying to save the new project to the mapped user drive (rather than on Guest OS) and it's giving this error.

 

VS Error.JPG

 

It's fine for something like Windows Forms Application. Is this likely to be some sort of permissions issue? I really hate having to set this up.

 

Thanks

Manny

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now



×
×
  • Create New...