Wednesday, March 14, 2012

Mountain mounting problems with Oracle VM VirtualBox on CentOS

I'm making more use of VirtualBox as a "free" virtualization tool on Linux, working alongside VMware Fusion that I use on the Mac.

My host OS is CentOS 6.2, and I'm using VirtualBox 4.1.8.

Having happily created VMs containing Windows Server 2003 R2 and Red Hat Enterprise Linux 5.5, I wanted to create a third VM running .... CentOS 6.2.

I went through the usual process to create the VM, and then added a new virtual CD/DVD drive to connect to the ISO that contains CentOS: -

CentOS-6.2-x86_64-LiveCD.iso

Sadly, however, VirtualBox through up a really useful ( NOT ) error message: -


Failed to open the CD/DVD image /media/LenovoExternal/Products/CentOS/CentOS-6.2-x86_64-LiveCD.iso.

The medium '/media/LenovoExternal/Products/CentOS/CentOS-6.2-x86_64-LiveCD.iso' can't be used as the requested device type.

Result Code: NS_ERROR_FAILURE (0x80004005)
Component: Medium
Interface: IMedium {53f9cc0c-e0fd-40a5-a404-a7a5272082cd}
Callee: IVirtualBox {c28be65f-1a8f-43b4-81f1-eb60cb516e66}


I did some digging around, but couldn't see anything obvious - I even tried re-running the setup script: -

$ sudo /etc/init.d/vboxdrv setup

but to no avail.

Knowing that this process had worked with other ISOs ( for W2K3 and RHEL ), I was pretty sure that the problem was with the ISO, rather than with VirtualBox.

I checked the permissions that I had to the ISO: -

$ ls -al /media/LenovoExternal/Products/CentOS/

total 714752
drwxr-xr-x. 1 nobody nobody         3 Jan 28 15:57 .
drwxrwxrwx. 1   1000   1000        63 Jan 28 15:57 ..
-rw-r-----. 1 nobody nobody 731906048 Dec 16 06:07 CentOS-6.2-x86_64-LiveCD.iso


I then compared this against the ISO for RHEL: -

$ ls -al /media/LenovoExternal/Products/RHEL/

total 6621424
drwxrwxrwx. 1 1000 1000          4 May 26  2010 .
drwxrwxrwx. 1 1000 1000         63 Jan 28 15:57 ..
-rwxrwxrwx. 1 1000 1000 3076845568 Jun 21  2009 RHEL5.2-Server-20080430.0-i386-DVD.iso
-rwxrwxrwx. 1 1000 1000 3703490560 May 25  2010 RHEL5.5-Server-20100322.0-x86_64-DVD.iso


Notice the difference ?

Yep, you guessed it - the permissions to the CentOS ISO were too restrictive e.g. the user that I'm running VirtualBox as - hayd - did not have access to the ISO.

I changed this as follows: -

$ chmod a+r CentOS-6.2-x86_64-LiveCD.iso

and VirtualBox popped into life.

Simple, now if only the VB message had been a BIT more revealing .....

No comments:

Post a Comment