Jump to content

Recommended Posts

Posted

So, I have Windows 7 & Visual Studio happily installed. I know some people (maybe all?) will get annoyed that I am asking this but I after reading the looong thread related to VirtualBox, I really could do with knowing the XML method people have used to lock down.

 

The logon script method is this, I think, but wanted to know how to go about doing it any other way.

 

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" registervm "C:\VM\StudentVM.vbox"

 

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata global GUI/SuppressMessages remindAboutAutoCapture,remindAboutMouseIntegration On,showRuntimeError.warning.HostAudioNotResponding ,remindAboutGoingSeamless,remindAboutInputCapture, remindAboutGoingFullscreen

 

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata global GUI/RestrictedGlobalSettingsPages General,Input,Update,Language,Display,Network,Exte nsions,Proxy

 

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata StudentVM GUI/RestrictedRuntimeMenus Machine,View,Devices,Help,Debug

 

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata StudentVM GUI/RestrictedStatusBarIndicators HardDisks,OpticalDisks,FloppyDisks,Network,USB,Sha redFolders,Features,Mouse,Keyboard

 

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata StudentVM GUI/RestrictedCloseActions SaveState,PowerOff,Restore

 

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" startvm StudentVM

 

Thanks

Manny

Posted (edited)

I think this one prevents users from being able to load the main VirtualBox management GUI at all (thus preventing them from adding their own VM, etc.). You'd need to provide them with a shortcut for launching your VM, however.

 

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata global GUI/Customizations noSelector

 

You can create a shortcut for a VM by right-clicking on it in the VirtualBox management GUI.

Edited by jthompson
Posted
We also set file permissions on the .vbox file to prevent users from being able to write changes to it. They could otherwise modify the properties of the VM by editing that file manually in a text editor.
Posted

Could you kindly tell us how the batch file with those commands looks like? I've tried it as it is and not got far. Running those commands individually works fine.

 

Thanks

Manny

Posted

Ours is thus:

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" registervm "C:\VM\Programming\Programming.vbox"

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata global GUI/SuppressMessages remindAboutAutoCapture,remindAboutMouseIntegrationOn,showRuntimeError.warning.HostAudioNotResponding,remindAboutGoingSeamless,remindAboutInputCapture,remindAboutGoingFullscreen,remindAboutMouseIntegrationOff,confirmGoingSeamless,confirmInputCapture,remindAboutPausedVMInput,confirmVMReset,confirmGoingFullscreen,remindAboutWrongColorDepth

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata global GUI/RestrictedGlobalSettingsPages General,Input,Update,Language,Display,Network,Extensions,Proxy

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" modifyhd "c:\VM\Programming\Snapshots\{0a521e44-08cd-4fdf-9471-1729cc93f3f0}.vmdk" --autoreset on

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata "C:\VM\Programming\Programming.vbox" GUI/RestrictedRuntimeMenus Machine,View,Devices,Help,Debug

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata "C:\VM\Programming\Programming.vbox" GUI/RestrictedStatusBarIndicators HardDisks,OpticalDisks,FloppyDisks,Network,USB,SharedFolders,Features,Mouse,Keyboard

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata "C:\VM\Programming\Programming.vbox" GUI/RestrictedCloseActions SaveState,PowerOff,Restore

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" startvm "C:\VM\Programming\Programming.vbox"

  • Thanks 1
Posted

Man, there are so many hurdles with this. After running the commands to test, it works by locking down things. What I didn't realise that it permananetly disbales the VirtualBox Manager.

 

Vbox.jpg

 

Is there any way of reversing this so that i can continue configuring the VM through the Manager?

 

Thanks

Manny

Posted
Man, there are so many hurdles with this. After running the commands to test, it works by locking down things. What I didn't realise that it permananetly disbales the VirtualBox Manager.

 

[ATTACH=CONFIG]47602[/ATTACH]

 

Is there any way of reversing this so that i can continue configuring the VM through the Manager?

 

Thanks

Manny

 

Try:

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata global GUI/Customizations ""

  • Thanks 1
Posted
Try:

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata global GUI/Customizations ""

 

I don't suppose you know how to reverse all the other commands, so that I can get the full menus back?

 

VM Menu.JPG

 

Thanks

Manny

Posted
That batch file is meant for the students to run the VM entirely headless. You should just run the VM normally via your standard virtualbox installation so you can make necessary adjustments etc.
  • Thanks 1
Posted
That batch file is meant for the students to run the VM entirely headless. You should just run the VM normally via your standard virtualbox installation so you can make necessary adjustments etc.

 

I understand that but wanted to test it out locally, on the station I am was configuring it. What I didn't know that once these commands are run, it will save the restrictions permanently on my station. And now I need to "unrestrict" so I can continue with configuration. Would I have to reinstall VB?

Posted
I don't suppose you know how to reverse all the other commands, so that I can get the full menus back?

 

[ATTACH=CONFIG]47610[/ATTACH]

 

Thanks

Manny

 

This should reset global settings:

"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata global GUI/Customizations ""
"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata global GUI/RestrictedGlobalSettingsPages ""
"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata global GUI/RestrictedMachineSettingsPages ""
"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata global GUI/MenuBar/Enabled ""
"C:\Program Files\Oracle\VirtualBox\vboxmanage.exe" setextradata global GUI/StatusBar/Enabled ""

Posted

So an update. Finally managed to put the commands in a vbscript and put a shortcut on start menu to run that vbscript. It looks like this:

 

Dim objShell

Set objShell = CreateObject("WScript.Shell")

 

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

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" setextradata global GUI/SuppressMessages remindAboutAutoCapture,remindAboutMouseIntegration On,showRuntimeError.warning.HostAudioNotResponding ,remindAboutGoingSeamless,remindAboutInputCapture, remindAboutGoingFullscreen", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" setextradata global GUI/RestrictedGlobalSettingsPages General,Input,Update,Language,Display,Network,Exte nsions,Proxy", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" modifyhd ""c:\ProgramData\VM\Snapshots\{123c48ce-8e1f-40f1-88a7-0caa6d204ea3}.vdi"" --autoreset on", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" setextradata global GUI/Customizations noSelector", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" setextradata Windows7 GUI/RestrictedRuntimeMenus Machine,View,Devices,Help,Debug", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" setextradata Windows7 GUI/RestrictedStatusBarIndicators HardDisks,OpticalDisks,FloppyDisks,Network,USB,Sha redFolders,Features,Mouse,Keyboard", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" setextradata Windows7 GUI/RestrictedCloseActions SaveState,PowerOff,Restore", 0

 

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

 

I know most of those commands because after running it I can't run Virtualbox Manager as it's locked down. The only issue is the last command has go and VM window comes up for a second or two and then disappears.

 

Any ideas on that one?

 

Thanks

Manny

Posted

Also, when you guys finished configuring your VM/Windows 7 the way you want it, do you simply make multiple copies of the vdi (or is it the entire Virtual Machine folder) to distribute?

 

Does it not complain about UUID not matching or something to that effect? Essentially need to know how best to distribute 8 copies/VMs.

 

Thanks again

Manny

Posted
Also, when you guys finished configuring your VM/Windows 7 the way you want it, do you simply make multiple copies of the vdi (or is it the entire Virtual Machine folder) to distribute?

 

Does it not complain about UUID not matching or something to that effect? Essentially need to know how best to distribute 8 copies/VMs.

 

Thanks again

Manny

 

You want to copy and distribute the entire folder for the VM, not just the vdi file.

  • Thanks 1
Posted

I've had to start again. Windows image was too big. Someone mentioned their total image was 16GB with Visual Studio? Visual Studio 2015 is 25GB on it's own...?

 

I'm just creating myself a lite version of Windows 7 Pro using RT Seven Lite. Long process, but hopefully will get a lighter version at the end.

Posted
Visual Studio 2015 is 25GB on it's own...?

Do a custom install to reduce the size. There's probably a lot you could leave out (like the Windows Phone-related bits).

Posted
Did anyone choose Dynamic Disk, instead of Fixed? I was thinking of going with Dynamic so that it only uses the bare minimum, rather than me over provisioning.
Posted

I'm having some real difficulty to get the locked down script to run succesfully.

 

Here is the script:

 

Dim objShell

Set objShell = CreateObject("WScript.Shell")

 

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

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" setextradata global GUI/SuppressMessages remindAboutAutoCapture,remindAboutMouseIntegration On,showRuntimeError.warning.HostAudioNotResponding ,remindAboutGoingSeamless,remindAboutInputCapture, remindAboutGoingFullscreen", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" setextradata global GUI/RestrictedGlobalSettingsPages General,Input,Update,Language,Display,Network,Exte nsions,Proxy", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" modifyhd ""C:\ProgramData\VirtualBox VMs\Lubuntu\Snapshots\{917a5bd8-7a68-4811-8b3c-7cc639e96532}.vdi"" --autoreset on", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" setextradata global GUI/Customizations noSelector", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" setextradata Windows7 GUI/RestrictedRuntimeMenus Machine,View,Devices,Help,Debug", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" setextradata Windows7 GUI/RestrictedStatusBarIndicators HardDisks,OpticalDisks,FloppyDisks,Network,USB,Sha redFolders,Features,Mouse,Keyboard", 0

 

objShell.Run """C:\Program Files\Oracle\VirtualBox\vboxmanage.exe"" setextradata Windows7 GUI/RestrictedCloseActions SaveState,PowerOff,Restore", 0

 

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

 

The errors in log:

 

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

00:00:00.002001 main Log opened 2018-02-16T09:42:31.034604500Z

00:00:00.002001 main Build Type: release

00:00:00.002001 main OS Product: Windows 8.1

00:00:00.002001 main OS Release: 6.3.9600

00:00:00.002001 main OS Service Pack:

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

00:00:00.021020 main DMI Product Version: 1.0

00:00:00.021020 main Host RAM: 8069MB (7.8GB) total, 6519MB (6.3GB) available

00:00:00.021020 main Executable: C:\Program Files\Oracle\VirtualBox\VBoxSVC.exe

00:00:00.021020 main Process ID: 868

00:00:00.021020 main Package type: WINDOWS_64BITS_GENERIC

00:00:00.022021 VirtualBox: object creation starts

00:00:00.022021 Home directory: 'C:\Users\wmbguest\.VirtualBox'

00:00:00.022021 Installed Drivers:

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

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

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

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

00:00:00.146493 HostDnsMonitor: old information

00:00:00.146493 no server entries

00:00:00.146493 no domain set

00:00:00.146493 no search string entries

00:00:00.146493 HostDnsMonitor: new information

00:00:00.146493 server 1: 10.88.160.21

00:00:00.146493 server 2: 10.88.0.21

00:00:00.146493 domain: school.org.uk

00:00:00.146493 no search string entries

00:00:00.146493 HostDnsMonitorProxy::notify

00:00:00.176522 VD: VDInit finished with VINF_SUCCESS

00:00:00.176522 VirtualBox: object created

00:00:00.180526 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 'Windows7'}, preserve=false aResultDetail=0

00:00:00.180526 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 'Windows7'}, preserve=false aResultDetail=0

00:00:00.180526 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 'Windows7'}, preserve=false aResultDetail=0

00:00:00.180526 ERROR [COM]: aRC=VBOX_E_FILE_ERROR (0x80bb0004) aIID={4afe423b-43e0-e9d0-82e8-ceb307940dda} aComponent={MediumWrap} aText={Could not find file for the medium 'C:\ProgramData\VirtualBox VMs\Lubuntu\Snapshots\{917a5bd8-7a68-4811-8b3c-7cc639e96532}.vdi' (VERR_FILE_NOT_FOUND)}, preserve=false aResultDetail=0

00:00:00.181527 Loading settings file "C:\ProgramData\VirtualBox VMs\Lubuntu\Lubuntu.vbox" with version "1.16-windows"

00:00:00.181527 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.181527 Saving settings file "C:\Users\wmbguest\.VirtualBox\VirtualBox.xml" with version "1.12-windows"

00:00:00.183529 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\Lubuntu\Lubuntu.vdi'}, preserve=false aResultDetail=0

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

00:00:05.200544 main VirtualBox: object deletion starts

00:00:05.200544 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={4afe423b-43e0-e9d0-82e8-ceb307940dda} aComponent={MediumWrap} aText={Medium 'C:\ProgramData\VirtualBox VMs\Lubuntu\Snapshots/{61e11dc7-7dbc-4fe4-8c20-afdd444f4086}.vdi' cannot be closed because it is still attached to 1 virtual machines}, preserve=false aResultDetail=0

00:00:05.200544 main ERROR [COM]: aRC=VBOX_E_OBJECT_IN_USE (0x80bb000c) aIID={4afe423b-43e0-e9d0-82e8-ceb307940dda} aComponent={MediumWrap} aText={Medium 'C:\ProgramData\VirtualBox VMs\Lubuntu\Lubuntu.vdi' cannot be closed because it is still attached to 1 virtual machines}, preserve=false aResultDetail=0

00:00:05.206220 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.207224 main VirtualBox: object deleted

 

Also in the log, it keeps referring to an OLD VM I had called Windows 7. I no longer have that anywhere, yet it keeps referring to it. Any ideas at all where this is going wrong?

 

Thank you

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...