How to use virtualbox programmatically to load OS image?

This is for discussing general topics about how to use VirtualBox.
Post Reply
Namrata
Posts: 1
Joined: 1. Nov 2008, 04:42

How to use virtualbox programmatically to load OS image?

Post by Namrata »

Hi,

I want to use VirtualBox to programmatically load a snapshot or OS image onto a machine. Could you please guide me how to do that if it is possible?

Please reply its very urgent, I am looking for API which will help me restore OS image :(

Thanks,
Namrata
aquarius
Posts: 69
Joined: 3. Jun 2008, 22:35
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: MS Windows XP

Post by aquarius »

Your best friend - as always - is the manual. The API is described there.

It boils down to something roughly along these lines (w/o any warranty)

Code: Select all

VBoxManage createvm -name “Your VM” -register
VBoxManage modifyvm “Your VM” -memory “128MB” -acpi on -boot1 dvd -nic1 intnet
VBoxManage createvdi -filename “VM.vdi” -size 4000 -register
VBoxManage modifyvm “Your VM” -hda “VM.vdi”
VBoxManage registerimage dvd /full/path/to/iso.iso
VBoxManage modifyvm “Your VM” -dvd /full/path/to/iso.iso
VBoxManage modifyvm “Your VM” -vrdpport 3390
VBoxVRDP -startvm “Your VM”
(Found here aka here by googling this.)

aquarius
Arulx Z
Posts: 2
Joined: 16. Aug 2015, 06:37

Re: How to use virtualbox programmatically to load OS image?

Post by Arulx Z »

I'm getting an error when I type:

Code: Select all

VBoxManage createvdi -filename “VM.vdi” -size 4000 -register
Error :

Code: Select all

Syntax error: unknown option: --register
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: How to use virtualbox programmatically to load OS image?

Post by Perryg »

Best place to see the syntax.

http://www.virtualbox.org/manual/ch07.h ... 5385220400

Notice the dbl --
Post Reply