Discussion:
More than one Directory for virtual drives
Harry Putnam
2014-03-20 22:14:06 UTC
Permalink
I'm using Vbox version 4.3.8r9245 on win 7 64 bit

I want to move some vms off to an external drive and wondered how to
go about having more than one directory in use for the virtual hdds

The way the *.xml file is worded it is called:

<SystemProperties defaultMachineFolder="B:\vb\vm"

the vary name suggests there can be only one 'default', so if I wanted
to keep some virt drives somewhere else... how would I edit the *.xml
file to add some kind of "secondaryMarchineFolder" or such like.
The vbox needs to know where to look, I'm sure.

Or is there some way to get Vbox to write the file differently, so as
to include more than one MachineFolder?

What I really hoped to do was move 3 vms to new directory manually and
then let VB know about by some finagling of the *.xml file.

Is that even a possibility?
Gregory Nowak
2014-03-21 02:56:29 UTC
Permalink
Post by Harry Putnam
I'm using Vbox version 4.3.8r9245 on win 7 64 bit
I want to move some vms off to an external drive and wondered how to
go about having more than one directory in use for the virtual hdds
<SystemProperties defaultMachineFolder="B:\vb\vm"
the vary name suggests there can be only one 'default', so if I wanted
to keep some virt drives somewhere else... how would I edit the *.xml
file to add some kind of "secondaryMarchineFolder" or such like.
The vbox needs to know where to look, I'm sure.
Or is there some way to get Vbox to write the file differently, so as
to include more than one MachineFolder?
What I really hoped to do was move 3 vms to new directory manually and
then let VB know about by some finagling of the *.xml file.
Is that even a possibility?
You don't need to play with the xml file. Remove the current machine
from vb, including hd images. Move them to where you want, and import
back into vb from the new directory. I've done this before with
vboxmanage, but haven't done it from the GUI. Importing a vdi from any
directory works from the GUI, but I'm not sure if that holds for the
machine description itself. Be aware that if the other storage isn't
attached when you launch the vb GUI, you'll get a warning that some
machines aren't accessible.

Greg
--
web site: http://www.gregn.net
gpg public key: http://www.gregn.net/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)

--
Free domains: http://www.eu.org/ or mail dns-manager-iDweQDFWK/***@public.gmane.org
Gregory Nowak
2014-03-21 03:19:18 UTC
Permalink
Post by Gregory Nowak
You don't need to play with the xml file. Remove the current machine
from vb, including hd images. Move them to where you want, and import
back into vb from the new directory. I've done this before with
vboxmanage, but haven't done it from the GUI. Importing a vdi from any
directory works from the GUI, but I'm not sure if that holds for the
machine description itself. Be aware that if the other storage isn't
attached when you launch the vb GUI, you'll get a warning that some
machines aren't accessible.
I forgot to mention that if all you want to do is just move hd images
to somewhere else, that's even easier. Remove the hd image from the
guest, and from the media manager. Move it to the new location, and
then just add the hd image back as an existing hard disk which is now
at your new location.

Greg


--
web site: http://www.gregn.net
gpg public key: http://www.gregn.net/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)

--
Free domains: http://www.eu.org/ or mail dns-manager-iDweQDFWK/***@public.gmane.org
Harry Putnam
2014-03-21 20:31:11 UTC
Permalink
Post by Gregory Nowak
Post by Gregory Nowak
You don't need to play with the xml file. Remove the current machine
from vb, including hd images. Move them to where you want, and import
back into vb from the new directory. I've done this before with
vboxmanage, but haven't done it from the GUI. Importing a vdi from any
directory works from the GUI, but I'm not sure if that holds for the
machine description itself. Be aware that if the other storage isn't
attached when you launch the vb GUI, you'll get a warning that some
machines aren't accessible.
I forgot to mention that if all you want to do is just move hd images
to somewhere else, that's even easier. Remove the hd image from the
guest, and from the media manager. Move it to the new location, and
then just add the hd image back as an existing hard disk which is now
at your new location.
I hadn't seen your post before I jumped the gun and started trying
things. One thing I tried is pretty close but different.

I copied a vm to a new location. Then tried to so import a drive. It
will not allow it, because it has the same ID number as an existing
drive.

So I guess I could disown it at the original vm but then there is no
gain in drives.

I don't see a way, using the 'add hdd' dialog. No chance to create on
at my address of choice is presented.

What I'd really like to do is create a couple more discs at a new
location but keep the vm and several disks at another.... the original
location.

Again, it appears that removing drives from the vm, and pulling them
in from a new address does not present a chance to actually add to the
number of drives on the original vm.

You mentioned having done similar things from the command line. I'd
be happy to do this from the command line. I'm a linux hand so no
stranger to command line.

I've never studied up on the proper commands with VB so would need
some coaching on that. But first:

Is it possible to create a HDD at a different address than the
'default' shown in *.xml and then add it to an existing VM.
The method you described involved dropping the drive from the existing
address vm OS. So, as I said... there would be no gain.

The end result I've imagined would be hdd at more than one address.
The new address is not remote but is on an external (usb3) disk.

In the vb gui for disc creation there appears to be no chance to
create a disc at an address of your own choice... instead you are
guided to the 'Default' in ~/VirtualBox/VirtualBox.xml

Can you help with command line coaching.... I guess I could try
creating 1 hdd in the old location. then not use dump it... although
I'm not sure how one dumps a drive in Openindiana but I can certainly
find out.

That would be your suggesting to the letter.
Will that work? Do you think?
Gregory Nowak
2014-03-21 21:17:29 UTC
Permalink
Post by Harry Putnam
I copied a vm to a new location. Then tried to so import a drive. It
will not allow it, because it has the same ID number as an existing
drive.
Which is why I said you need to first remove the drive from existing
guests, and then ultimately from the virtual media manager.
Post by Harry Putnam
So I guess I could disown it at the original vm but then there is no
gain in drives.
What do you mean there is no gain in drives? My understanding is that
you simply want to move a guest including drives from one location on
your host to somewhere else. If this isn't what you want to do, then
maybe you should start by stating what you want to accomplish.
Post by Harry Putnam
I don't see a way, using the 'add hdd' dialog. No chance to create on
at my address of choice is presented.
When you add an hdd, it asks you to browse for the file. Browse to the
drive image in question, and it should just be added for you. Perhaps
you need to explain in detail what you're doing, what the results are,
and what you expect the results to be if the two differ.
Post by Harry Putnam
What I'd really like to do is create a couple more discs at a new
location but keep the vm and several disks at another.... the original
location.
No problem. Go into the virtualbox GUI. Select the machine you want to
work with. Select settings from the machine menu. Navigate to the
storage tab. Under storage, select the controller under which you want
to add the drive (I.E. "SATA Controller"). I use my applications key
on my keyboard to bring up the context menu for the controller in
question, for mouse users, I believe right clicking on the controller
would do the same thing. From the context menu that comes up, select
"Add Hard Disk." When you select that, select the option to create a
new disk. Follow the steps to create a new disk. Yes, the new disk
will be created in the same location as the guest. Once the disk is
created, release it from the guest and from the media manager. Move
the file containing the new disk to where you want it to be. Follow
the steps I gave above to add a new hdd. When you get to create drive,
or choose existing drive, select to choose existing drive. Browse for
the file from there, it should be straight forward. One tip, when you
move the drive, and before you reimport it from the new location, feel
free to rename it to whatever you want, instead of just having it be
called drive1, or however vbox names it. Yes, this is a bit
tedious. It isn't that bad when using vboxmanage, since you can create
the drive without also registering it. That means you can then move it
right after creation, and then just import from the new location.
Post by Harry Putnam
Again, it appears that removing drives from the vm, and pulling them
in from a new address does not present a chance to actually add to the
number of drives on the original vm.
See above.
Post by Harry Putnam
You mentioned having done similar things from the command line. I'd
be happy to do this from the command line. I'm a linux hand so no
stranger to command line.
I've never studied up on the proper commands with VB so would need
Start with reading chapter 8 of the virtualbox manual, it tells you
everything you need to know.
Post by Harry Putnam
Is it possible to create a HDD at a different address than the
'default' shown in *.xml and then add it to an existing VM.
Not as far as I know.
Post by Harry Putnam
The method you described involved dropping the drive from the existing
address vm OS. So, as I said... there would be no gain.
Again, see above. You can add as many new drives as you want at
different locations using that procedure. Tedious, but it does
work. Learn to use vboxmanage if you want it to be less tedious.
Post by Harry Putnam
The end result I've imagined would be hdd at more than one address.
Ok, that's different than my understanding of what you wanted. I know
virtualbox supports sharing one drive between many guests. I never
needed to use that feature though, so am not sure if you could move
such a drive around as well.

Greg
--
web site: http://www.gregn.net
gpg public key: http://www.gregn.net/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)

--
Free domains: http://www.eu.org/ or mail dns-manager-iDweQDFWK/***@public.gmane.org
Gregory Nowak
2014-03-22 00:46:12 UTC
Permalink
Post by Gregory Nowak
It isn't that bad when using vboxmanage, since you can create
the drive without also registering it. That means you can then move it
right after creation, and then just import from the new location.
I thought I remembered something, and just tried it here. You
don't even need to move the hd image after creating it with
vboxmanage; you can create it directly where you want it it. So,
either open a command prompt window where you want the hd image to be
created, or cd/drive_letter: until you end up in
wherever you want to put the hd image. Then type:

vboxmanage createhd --filename test.vdi --size 1000

This would create a dynamic test.vdi in your current directory, which
would appear to the guest as a 1000mb drive. You should also be able
to give the full path to the --filename flag if you don't want to cd
your way to it. Unless you have where vboxmanage.exe resides already
in your path (you need to add that yourself), you'll have to invoke
vboxmanage.exe by specifying the full path to it. Do a search for
vboxmanage.exe, and you'll find what the exact path is. Alternatively,
you could just skip running cmd.exe, and browse to it from the run
dialogue, and input all the arguments there.

Greg
--
web site: http://www.gregn.net
gpg public key: http://www.gregn.net/pubkey.asc
skype: gregn1
(authorization required, add me to your contacts list first)

--
Free domains: http://www.eu.org/ or mail dns-manager-iDweQDFWK/***@public.gmane.org
Harry Putnam
2014-03-22 03:23:24 UTC
Permalink
Post by Gregory Nowak
I thought I remembered something, and just tried it here. You
don't even need to move the hd image after creating it with
vboxmanage; you can create it directly where you want it it. So,
[...]

You last two posts nailed it. Thanks.

I'd sort of stumbled on to most of it... but that command line trick
really makes it simple.... Thanks again
Cliff Scott
2014-03-25 03:36:28 UTC
Permalink
Test of email cfly.

Continue reading on narkive:
Loading...