Results 1 to 6 of 6

Thread: Move VirtualBox home directory

  1. #1
    Join Date
    Aug 2008
    Location
    Mexico and Sweden
    Posts
    1,358

    Default Move VirtualBox home directory

    OpenSuse 11.4 64bit

    I have installed and run VB successfully. I am using it to test another Linux distribution. When started VB creates its default directory in my home directory and stores its .vdi file there. I would like to have the entire directory on another drive (not USB), on partition sdb6. Is this possible? When I start VB it does not give me an option as to where to keep its files.

    Thanks.

  2. #2
    Join Date
    Aug 2008
    Location
    Seattle, WA
    Posts
    1,376

    Default Re: Move VirtualBox home directory

    Quote Originally Posted by ionmich View Post
    OpenSuse 11.4 64bit

    I have installed and run VB successfully. I am using it to test another Linux distribution. When started VB creates its default directory in my home directory and stores its .vdi file there. I would like to have the entire directory on another drive (not USB), on partition sdb6. Is this possible? When I start VB it does not give me an option as to where to keep its files..
    You can change the default directory in Preferences->General. This will not move existing machines. The process for the latter is very complex and involves editing XML files. If you're just testing, it would be easier to start over and build a new machine with the new directory.

  3. #3
    Join Date
    Jun 2008
    Location
    The English Lake District. UK - GMT/BST
    Posts
    36,743
    Blog Entries
    20

    Default Re: Move VirtualBox home directory

    Yes it is possible.
    Problem is I no longer bother with Virtual Box, so I can't just get you the specific info. But I know I have done it myself some years ago.
    Specifically though I was only concerned with the actual large machine images.
    I have a machine that I maintain and the customer places the .vdi's in a different location. When I re-setup his system with a new installation. I just start VBox (with none of it's config files in place) (it's a formatted /home) > then I create New Machine > and select from existing HD > then I just point it to the location of the stored .vdi's
    The only requirement is that the location must be available Read/Write to VBox.

    So in your case. I'd probably backup just the .vdi's to the new location, place then in a folder Eg: Virtual_Machines
    Delete all your existing files and folders in /home
    So when you start VBox it's like the first run
    Create a New Machine and just do as I described
    Leap 15.1_KDE
    My Articles Was I any help? If yes: Click the star below

  4. #4

    Default Re: Move VirtualBox home directory

    Quote Originally Posted by ionmich View Post
    When started VB creates its default directory in my home directory and stores its .vdi file there. I would like to have the entire directory on another drive (not USB), on partition sdb6. Is this possible?
    I'm just doing this, and it is incredibly easy. Just use a symlink.

    I assume your /dev/sdb6 is mounted under /mnt/sdb6 and is owned by your user account, something like
    > drwxr-xr-x 4 ionmich users 10240 Mar 21 10:00 /mnt/sdb6
    Make sure no VirtualBox process is running (so no process might have open files in ~/VirtualBox VMs). Do this in a terminal:
    Code:
    # This will copy all your VirtualBox'es to /mnt/sdb6
    rsync -rP "~/VirtualBox VMs" /mnt/sdb6
    # This renames the old VirtualBox VMs (you can delete
    # it after checking that the new setting works for you)
    mv "~/VirtualBox VMs" ~/VirtualBox.old
    # This creates a symlink to the new place
    ln -s "/mnt/sdb6/VirtualBox VMs" "~/VirtualBox VMs"
    There is no need to change path settings anywhere. Check if VirtualBox works as expected. Maybe create a new VB and see if it shows up somewhere in /mnt/sdb6/VirtualBox VMs. If everythink works fine, remove the VirtualBox.old directory.

    Yarny

  5. #5
    PeeGee NNTP User

    Default Re: Move VirtualBox home directory

    On 21/03/12 04:06, caf4926 wrote:
    >
    > Yes it is possible.
    > Problem is I no longer bother with Virtual Box, so I can't just get you
    > the specific info. But I know I have done it myself some years ago.
    > Specifically though I was only concerned with the actual large machine
    > images.
    > I have a machine that I maintain and the customer places the .vdi's in
    > a different location. When I re-setup his system with a new
    > installation. I just start VBox (with none of it's config files in
    > place) (it's a formatted /home)> then I create New Machine> and select
    > from existing HD> then I just point it to the location of the stored
    > .vdi's
    > The only requirement is that the location must be available Read/Write
    > to VBox.
    >
    > So in your case. I'd probably backup just the .vdi's to the new
    > location, place then in a folder Eg: Virtual_Machines
    > Delete all your existing files and folders in /home
    > So when you start VBox it's like the first run
    > Create a New Machine and just do as I described
    >
    >


    IIRC, all I did was to copy the relevant directory to a "dedicated"
    partition and insert a link to the new location (after renaming the
    directory in .VirtualBox, which was then removed after testing). I do
    not recall any problems.

    --
    PeeGee

    MSI m/b 870-C45, AMD Athlon II X3 445, 4GB, openSUSE 11.4/11.3 x86_64
    dual boot + XP Home in VBox
    Asus m/b M2NPV-VM, AMD 64X2 3800+, 2GB, openSUSE 11.3 x86_64/XP Home
    dual boot
    Acer Aspire 1350, AMD (M)XP2400+, 768MB, openSUSE 11.4/XP Home dual boot
    Asus eeePC 4G (701), Celeron M353, 2GB, openSUSE 11.3 on SSD

  6. #6
    Join Date
    Aug 2008
    Location
    Mexico and Sweden
    Posts
    1,358

    Default Re: Move VirtualBox home directory

    Quote Originally Posted by chief_sealth View Post
    You can change the default directory in Preferences->General. This will not move existing machines. The process for the latter is very complex and involves editing XML files. If you're just testing, it would be easier to start over and build a new machine with the new directory.
    Thanks everybody. I liked this answer the best, as I am in the intial stages of experimentation, and the solution is simple and works. I am trying to remaster a live Knoppix CD. What I initially thought was a VirtualBox problem has developed into a Knoppix problem. I can install the OS to the VB drive, but then when it boots it cannot find its files unless VB is installed to my home directory. That directory does not have sufficient available space to handle the many files needed for remastering. Rather than mess around with enlarging with gparted I have decided to install another OpenSuse 11.4 to a spare drive with a large /home directory.

    Thanks again. The support on this forum is marvelous compared to others.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •