Page 1 of 1
Import Appliance Target Path
Posted: 11. Aug 2010, 17:51
by flatlander
Hello All,
I have created a virtual machine. I then exported it as an appliance. Now I would like to import the appliance but I want to have the hard disk file saved in a specific directory. So far I have tried:
1. Importing through the GUI and editing the hd location, but after the import was done it is in the default location.
2. Tried VBoxManage but I can not find a parameter for import that will allow me to specify where to put the vmdk.
My host is an OSX machine and it always wants to put it in /Users/<username>/Library/VirtualBox/HardDisks.
Which in my case in an nfs mount and I do not want all of my users putting VM's in their NFS-homes.
Ideas / Suggestions?
Thanks
TIA
Re: Import Appliance Target Path
Posted: 11. Aug 2010, 18:24
by Perryg
See
Chapter 1.11. Importing and exporting virtual machines and
Chapter 8.8. VBoxManage import in your VirtualBox users guide.
Just change the location of the Hard Disk Image.
Code: Select all
11: Hard disk image: source image=WindowsXp.vmdk,
target path=/home/user/disks/WindowsXp.vmdk, controller=9;channel=0
(change controller with "--vsys 0 --unit 11 --controller <id>";
disable with "--vsys 0 --unit 11 --ignore")
Re: Import Appliance Target Path
Posted: 11. Aug 2010, 18:56
by flatlander
Perryg wrote:See
Chapter 1.11. Importing and exporting virtual machines and
Chapter 8.8. VBoxManage import in your VirtualBox users guide.
Just change the location of the Hard Disk Image.
Code: Select all
11: Hard disk image: source image=WindowsXp.vmdk,
target path=/home/user/disks/WindowsXp.vmdk, controller=9;channel=0
(change controller with "--vsys 0 --unit 11 --controller <id>";
disable with "--vsys 0 --unit 11 --ignore")
I have not been able to figure out the command to do it. From what I can tell I can only change the controller id??
Thanks
Re: Import Appliance Target Path
Posted: 11. Aug 2010, 19:12
by Perryg
If you use the GUI to import you just need to double click on the file location and put the full path to where you want it to be install.
Re: Import Appliance Target Path
Posted: 11. Aug 2010, 21:15
by flatlander
Perryg wrote:If you use the GUI to import you just need to double click on the file location and put the full path to where you want it to be install.
Man I will try it again. I thought I did that but it still copied to ~/Library/Virt.... directory.
I will try again.
Thanks
Re: Import Appliance Target Path
Posted: 11. Aug 2010, 21:39
by Perryg
Here I am importing from a shared drive to an external drive on Linux host. Just remember that you must use the full path.
Re: Import Appliance Target Path
Posted: 11. Aug 2010, 22:37
by flatlander
flatlander wrote:Perryg wrote:If you use the GUI to import you just need to double click on the file location and put the full path to where you want it to be install.
Man I will try it again. I thought I did that but it still copied to ~/Library/Virt.... directory.
I will try again.
Thanks
Tried again and when I double click on the box with the target path it let's me edit it. Then I click out and start the import, but it still is writing the file to the ~/Library/Virtual.....
Maybe this is OSX specific?
Anyone know who to make it work with VBoxManage? I really need to script this whole process.
Re: Import Appliance Target Path
Posted: 12. Aug 2010, 15:14
by flatlander
flatlander wrote:flatlander wrote:Perryg wrote:If you use the GUI to import you just need to double click on the file location and put the full path to where you want it to be install.
Man I will try it again. I thought I did that but it still copied to ~/Library/Virt.... directory.
I will try again.
Thanks
Tried again and when I double click on the box with the target path it let's me edit it. Then I click out and start the import, but it still is writing the file to the ~/Library/Virtual.....
Maybe this is OSX specific?
Anyone know who to make it work with VBoxManage? I really need to script this whole process.
Bump. Bump.
Re: Import Appliance Target Path
Posted: 5. Nov 2010, 10:37
by uppe
Re-bump.
Re: Import Appliance Target Path
Posted: 5. Nov 2010, 11:47
by uppe
Setting the environment variable VBOX_USER_HOME let me change the target path.
Just prefix the VBoxManage command with for example VBOX_USER_HOME=/var/virtualbox
Re: Import Appliance Target Path
Posted: 11. Dec 2012, 16:16
by randyjames
There seems to be some resistance to answering the original question: "How do you change the target path using VBoxManage?"
Here's the "documentation" for item 11:
11: Hard disk image: source image=WindowsXp.vmdk,
target path=/home/user/disks/WindowsXp.vmdk, controller=9;channel=0
(change controller with "--vsys 0 --unit 11 --controller <id>";
disable with "--vsys 0 --unit 11 --ignore")
I presume the first part goes something like this:
--vsys 0 --unit 11
After that, who knows? In the example above, the 'path' appears to point to a file, so it might be any of:
--path /usr/local/myvboxhome/<vdkfilename>
--path=/usr/local/myvboxhome/<vdkfilename>
--target /usr/local/myvboxhome/<vdkfilename>
--target path=/usr/local/myvboxhome/<vdkfilename>
--target-path=/usr/local/myvboxhome/<vdkfilename>
I even read one comment somewhere that said it was none of the above, and that the parameter was actually:
--disk /usr/local/myvboxhome
(with just the path, not the destination filename)
When the person asking for help says something like "I really need to script this...", why try to re-direct him or her to GUI, or an environment parameter? If there is no way to do a command line import and define a new "--target path", that would be helpful to know. Better, a specific example of how to set the target path using the CLI "import" command. Best: including the syntax in the reference manual rather than:
[more options]
(run with -n to have options displayed for a particular OVF)
If anyone knows what goes after the --vsys 0 --unit 11 portion of the command line that sets the destination directory path, it would certainly be helpful to see a simple example. It would also be helpful to know if the path reference refers to a directory, or the actual name of the file.
Thanks in advance.
(Thanks in advance.)
Re: Import Appliance Target Path
Posted: 27. Feb 2013, 16:38
by rgoers
This may be a little late in coming... but I was searching for the same info and had to stumble upon the answer by experimenting on my own. The help is very confusing when it comes to setting the target path. Here's what I found actually works:
--vsys 0 -- unit 10 --disk <path/fn>
for example:
--vsys 0 --unit 10 --disk /mnt/scratch/import_test.vmdk
will place the new VM (import_test.vmdk) in your local machine's "/mnt/scratch" directory.
The entire command might look like this:
VBoxManage import ~/subdir1/subdir2/win7_vm/exported_vm.ova --vsys 0 --unit 11 --disk /mnt/scratch/import_test.vmdk
Hope that helps someone... maybe the help documentation could be re-written to be more consistent with the rest of the conventions used in VBoxManage (i.e. "--memory <MB>", and "--vname <name>", etc.). If help displayed "--disk <path/fn>" instead of "--disk path", it would be much easier to understand how to set the target path.
One more note: The (above) will import the machine into the account you are logged into - so if you're root when you import, it will go into root's VB GUI - if you're logged into your user account, it will go into your user account VB GUI.