VectorLinux
October 22, 2014, 03:46:33 pm *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
News: Visit our home page for VL info. To search the old message board go to http://vectorlinux.com/forum1. The first VL forum is temporarily offline until we can find a host for it. Thanks for your patience.
 
Now powered by KnowledgeDex.
   Home   Help Search Login Register  
Please support VectorLinux!
Pages: [1]
  Print  
Author Topic: VirtualBox problem  (Read 11972 times)
mick12345678
Vectorite
***
Posts: 140


« on: October 10, 2010, 12:04:11 pm »

I tried to get VirtualBox to load my MINT partition from within VL6 following the How To   (http://forum.vectorlinux.com/index.php?topic=12176.0).
I created the vmdk file ok (though I had to login as root), but when I tried to start the VM, I got a file permissions error
Quote
Failed to open a session for the virtual machine MINT.
Failed to open image '/home/user/myvbox/partition.vmdk' for writing due to wrong permissions (VERR_VD_IMAGE_READ_ONLY).
Failed to attach driver below us! Image is read-only. (VERR_VD_IMAGE_READ_ONLY).
AHCI: Failed to attach drive to Port0 (VERR_VD_IMAGE_READ_ONLY).
Unknown error creating VM (VERR_VD_IMAGE_READ_ONLY).

I can't see whats wrong with the permissions though :

Code:
vector:/~/myvbox
user:$ ls -lat
total 12
drwxr-xr-x  2 user user 4096 2010-10-10 20:52 ./
-rwxrwxrwx  1 user root  537 2010-10-10 20:52 partition.vmdk*
drwxr-xr-x 38 user user 4096 2010-10-10 20:48 ../

Logged
bigpaws
Vectorian
****
Posts: 1856


« Reply #1 on: October 10, 2010, 12:43:35 pm »

If you had to login as root to create the image files then the permissions
will be wrong.

You need to run Virtualbox as the user and create all files in the users /home. You
could create another partition however the permissions need to be set properly.

Bigpaws
Logged
mick12345678
Vectorite
***
Posts: 140


« Reply #2 on: October 10, 2010, 01:16:39 pm »

Thanks.
Here's what happens when I try to create the vmdk file without logging in as root :

Code:
user:$ VBoxManage internalcommands createrawvmdk -filename /home/user/myvbox/partition2.vmdk -rawdisk /dev/sda2 -register
Oracle VM VirtualBox Command Line Management Interface Version 3.2.8
(C) 2005-2010 Oracle Corporation
All rights reserved.

ERROR: VMDK: could not open raw disk file '/dev/sda2'
Error code VERR_ACCESS_DENIED at /home/vbox/tinderbox/3.2-lnx32-rel/src/VBox/Devices/Storage/VmdkHDDCore.cpp(3503) in function int vmdkCreateRawImage(VMDKIMAGE*, VBOXHDDRAW*, uint64_t)
Error while creating the raw disk VMDK: VERR_ACCESS_DENIED
The raw disk vmdk file was not created
Logged
newt
Vectorian
****
Posts: 1132



« Reply #3 on: October 10, 2010, 01:55:34 pm »

mick, is your user part of the 'disk' group? You can check /etc/group for this (cat /etc/group | grep disk).
Logged
mick12345678
Vectorite
***
Posts: 140


« Reply #4 on: October 11, 2010, 08:45:41 am »

My username is "user", so looks like it is part of the 'disk' group..


Code:
user:$ cat /etc/group | grep disk
disk:x:6:adm,user

Below, I have showed a full listing of what happens. By doing everything as root, I managed to make some sort of progress (i.e. I ended up with a different error  Roll Eyes ).

Code:
!
! as root, unmount the MINT partition
!
root:# umount  /mnt/tmp
!
! as user, try to create the vmdk file
!
user:$ VBoxManage internalcommands createrawvmdk -filename /home/user/myvbox/partition2.vmdk -rawdisk /dev/sda2 -register
!
! but it fails
!
Oracle VM VirtualBox Command Line Management Interface Version 3.2.8
ERROR: VMDK: could not open raw disk file '/dev/sda2'
Error code VERR_ACCESS_DENIED at /home/vbox/tinderbox/3.2-lnx32-rel/src/VBox/Devices/Storage/VmdkHDDCore.cpp(3503) in function int vmdkCreateRawImage(VMDKIMAGE*, VBOXHDDRAW*, uint64_t)
Error while creating the raw disk VMDK: VERR_ACCESS_DENIED
The raw disk vmdk file was not created
!
! try again, as root this time
!
root:#  VBoxManage internalcommands createrawvmdk -filename /home/user/myvbox/partition2.vmdk -rawdisk /dev/sda2 -register
!
! now it works
!
Oracle VM VirtualBox Command Line Management Interface Version 3.2.8
(C) 2005-2010 Oracle Corporation
All rights reserved.
RAW host disk access VMDK file /home/user/myvbox/partition2.vmdk created successfully.
vector://home/user/myvbox
!
! now change permissions on the file
!
root:# chmod a=rwx partition2.vmdk
root:# ls -lat
drwxr-xr-x  2 user user 4096 2010-10-11 19:18 ./
-rwxrwxrwx  1 root root  537 2010-10-11 19:18 partition2.vmdk*
drwxr-xr-x 38 user user 4096 2010-10-11 17:48 ../
!
! VBox now lets me define a new machine using this file as the h/d, but won't let me START it
!
Failed to open image '/home/user/myvbox/partition2.vmdk' for writing due to wrong permissions
(VERR_VD_IMAGE_READ_ONLY).
Failed to attach driver below us! Image is read-only. (VERR_VD_IMAGE_READ_ONLY).
AHCI: Failed to attach drive to Port0 (VERR_VD_IMAGE_READ_ONLY).
Unknown error creating VM (VERR_VD_IMAGE_READ_ONLY).
!
! so go to the console and start VirtualBox from the cmd line.
! Now I CAN create & start with no permission errors BUT I get
!
FATAL : No bootable medium found! System halted
« Last Edit: October 11, 2010, 10:51:35 am by mick12345678 » Logged
newt
Vectorian
****
Posts: 1132



« Reply #5 on: October 11, 2010, 10:34:17 am »

After reading through a few threads on external bug trackers and forums, other users of Vbox (osx users) have been able to resolve the issue by means of changing permissions of both the virtualbox files as well as the actual device file (i.e. /dev/sda1). The obvious concern is that you're opening up permissions on a device file too much.  If I can track down the threads I'll post link here.

link: http://www.virtualbox.org/ticket/1461
Logged
mick12345678
Vectorite
***
Posts: 140


« Reply #6 on: October 11, 2010, 11:03:44 am »

Thanks - looks like our post crossed.

In my latest effort, I was root all the way, so that surely takes care of any permissions issues.

I am trying to get Vbox to boot a partition which is normally booted from LILO in the MBR..is that even possible ?
That is,  the MINT partition has no GRUB or LILO itself.
Logged
mick12345678
Vectorite
***
Posts: 140


« Reply #7 on: October 13, 2010, 11:13:37 am »

Just upgraded to the latest version of Vbox.
Don't know if that was what did it or if it was the fact that this time I had the partition mounted, but now I can create the file as normal user.

But I still get the same error when I try to 'start' the virtual machine :

Code:
FATAL : No bootable medium found! System halted

Tried this with the partition mounted & unmounted, but no difference.

Could this be because theres no loader installed on the partition (LILO is on the MBR) ?
Logged
bigpaws
Vectorian
****
Posts: 1856


« Reply #8 on: October 13, 2010, 05:18:47 pm »

You need to have the cdrom or ISO available.

After you setup a new image you should get a
an option on intial start to allow cdrom pass
through.

Bigpaws

Logged
mick12345678
Vectorite
***
Posts: 140


« Reply #9 on: October 14, 2010, 09:12:53 am »

thanks - but the whole point of this exercise is to avoid a reinstall.
 I want to be able to VB-boot from the partition thats already been put there for multi-booting.
Logged
newt
Vectorian
****
Posts: 1132



« Reply #10 on: October 14, 2010, 09:32:17 am »

I do not believe that bigpaws is suggesting any kind of re-install. It sounds like what he's saying is that Virtualbox NEEDS a cdrom (physical or virtual/iso) available the first time it boots, but after that it will no longer be needed. Something along the lines of "vitualbox REQUIRES a cdrom the first time it boots ANYTHING, and after that it will no longer require a cdrom".  In essence, once you boot the first time using the cdrom you could then simply reboot using your existing MINT virtual machine and it will no longer require the cdrom.
Logged
mick12345678
Vectorite
***
Posts: 140


« Reply #11 on: October 14, 2010, 10:34:36 am »

I see - thanks for the clarification.

Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!