| Subcribe via RSS

Sharing folders beetween a Linux Host and a Windows VM using VirtualBox and VBoxManage

January 23rd, 2010 | No Comments | Posted in Storage, Virtualization

Had a predicament recently, whereby on my Fedora 12 box i couldnt manage music on my IPhone.

Now i installed VirtualBox, install Windows XP within that, Itunes within that etc etc and mapped the USB Path of the phone through to the Virtual machine. Now, all my music is on my host drives, and not accessible by the virtual machine – unless i want to do it very elementarily and create samba shares (which i dont!).

So, I researched how to share host folders using “VBoxManage” – a tool bundled with VirtualBox. Now, say you have a virtual machine called “x” – and you want to share the folder “/home/Sam/share”, with the share name showing as “HostShare1″ on the Windows side, you need to fire open the CLI (NOTE: Dont run as root if you made the VM as your user, UID’s problems) and run the following:

  • [Sam@SMNET ~]$ VBoxManage sharedfolder add x -name HostShare -hostpath /home/Sam/share

Now, lets deconstruct. “VBoxManage” is the program, and it IS case sensitive so bear it in mind.
“sharedfolder” is a parameter of the program which tells it you are about to create a shared folder.
“add x” tells it the ACTION (add) and what virtual machine name you want to action to (“x”).
“-name HostShare” is what the share will be called from the Windows clients perspective, again this is a parameter.
“-hostpath /home/Sam/share” tells the virtualbox program where to map the name “HostShare” to, i.e. /home/Sam/..

  • Once this command is ran, it should pass successfully:
  • [Sam@SMNET ~]$ VBoxManage sharedfolder add x -name HostShare -hostpath /home/Sam/share
  • VirtualBox Command Line Management Interface Version 3.1.0
  • (C) 2005-2009 Sun Microsystems, Inc.
  • All rights reserved.
  • [Sam@SMNET ~]$

However, if it does not you may need to re-read the notes. For example, if you get the message like below:

  • [Sam@SMNET ~]$ VBoxManage sharedfolder add x -name Media2 -hostpath /media/Other\ Media/
  • VirtualBox Command Line Management Interface Version 3.1.0
  • (C) 2005-2009 Sun Microsystems, Inc.
  • All rights reserved.
  • ERROR: A session for the machine ‘x’ is currently open (or being closed)
  • Details: code VBOX_E_INVALID_OBJECT_STATE (0x80bb0007), component Machine, interface IMachine, callee nsISupports
  • Context: “OpenSession(a->session, uuid)” at line 750 of file VBoxManageMisc.cpp

The above means the virtual machine is not powered off when you ran the command, which it needs to be. Also, if you get the message “command not found” you will need to ensure you have the case sensitive, i.e. Capital VB etc.

Now, we have configured the Linux side successfully, time for the easy bit. Turn on the VM, and go to “Start” and then “Run..”. In there, type “\\vboxsrv\HostShare” – and hit enter. And voila, you shared folder will appear. Now, to deconstruct again. “\\vboxsrv” is a preset parameter which tells the virtual machine the shared folder is stored on the host PC/Server (Your Linux install in this case). The “\HostShare” should look familiar as that is the name we set in our “…add x -name HostShare….” command.

Now, go forth and share!

Sam.

Virtual Networking Idea

November 18th, 2008 | No Comments | Posted in Networking, Virtualization

In normal P2P transfer/ad-hoc network transfer; the data transfer rate (MBps) is constrained by the medium; the NIC, the stack and the drivers, normally limiting to either 100Mbps or 1000Mbps (full/half). These are physical issues which need to be addressed at a layer 1 level / layer 2 level.

My question to you, the world, is – why arent virtual networking p2p transfers faster? If you want to transfer files beetween 1 VM and another VM; the transfer should be upwards of 1/2GBps – as you are transferring files in beetween the same file system (granted via a few security measures). There is no interaction with the physical NIC’s or mediums at all. In theory, all it will be doing (please correct me if wrong), is transferring a file out of the virtual machine hard drive, from the hard drive through the VM Container, out onto the VMBus/Hypervisor bus, back into the other container, and then into the other VM’s hard drive. The only constraint here, is the TCP/IP stack, which im sure can be slightly modified / a new protocol made for VM Transfer, allowing 2/3/4 GBps and upwards transfer.

Sam Marsh 2008 (c)

Tags: ,

Hyper-V Fun…

August 14th, 2008 | No Comments | Posted in Microsoft, Virtualization

Or not. Managed to procure Windows Server 2008 w/ Hyper-V and a 120-day evaluation license yesterday. I promptly installed it on a Proliant DL380, went to install Hyper-V at which point it stated you must have Intel-VT enabled on this machine in order for Hyper-V to run. After much tabbing through pages of BIOS, i decided to give up on that server and use one of the other hundred available!

On the second machine, we enabled VT, installed Win Server 08, and then went to “add component > Hyper-V”, which also installed without error. On reboot of the server, it informed us that Hyper-V Virtual Machine Manager (VMM), aka The Important Bit, had failed to initialise, meaning we couldnt add any new VM’s, which is brilliant. When we tried to manually start the process, we recieved “Parameter Incorrect: Error 87″.

According to a colleague who has been on a Windows Server 2008 training course, this is caused by, nonsensically, the language being set to “non US”, i.e. not EN-US, during installation. I dont know WHY this should affect anything but apparently it does – i should have learned a long time ago that Microsoft and Logic dont go hand in hand. C’est la vie.

Tags: , , ,