"Raw hard disk access" in Solaris

Discussions related to using VirtualBox on Solaris hosts.
angadsingh
Posts: 8
Joined: 1. Jun 2008, 07:28

"Raw hard disk access" in Solaris

Post by angadsingh »

I am trying to do raw hard disk access on my OpenSolaris 2008.05 system to boot Windows XP on the physical hard disk.

I tried the following command:

# exec VBoxManage internalcommands createrawvmdk -filename /export/home/angad/windows.vmdk /dev/dsk/c5d0 -register

And get the following output:

which: no internalcommands in (/usr/gnu/bin:/usr/bin:/usr/X11/bin:/usr/sbin:/sbin)
Unknown application -

It's not working. Any idea what's wrong?
aribi
Posts: 36
Joined: 12. Apr 2008, 00:36

"Raw hard disk access" in Solaris

Post by aribi »

Hi,

This is just some guessing from reading the VBoxManage helptext:

createrawvmdk -filename <filename> -rawdisk <diskname>
[-partitions <list of partition numbers> [-mbr <filename>] ]
[-register] [-relative]
Creates a new VMDK image which gives access to an entite host disk (if
the parameter -partitions is not specified) or some partitions of a
host disk. If access to individual partitions is granted, then the
parameter -mbr can be used to specify an alternative MBR to be used
(the partitioning information in the MBR file is ignored).
The diskname is on Linux e.g. /dev/sda, and on Windows e.g.
\\.\PhysicalDisk0).
On Linux host the parameter -relative causes a VMDK file to be created
which refers to individual partitions instead to the entire disk.
Optionally the created image can be immediately registered.
The necessary partition numbers can be queried with
VBoxManage internalcommands listpartitions
So the command seems to need "-rawdisk <diskname>"; not just <diskname>
And if you enter something along the line of /dev/dsk/... be sure it exists; seems to me this needs to be an entry describing the whole disk (/dev/dsk/c5d0s2 in lingua solaria ;) starting with the master boot record.

kind regards, Arie Bikker
angadsingh
Posts: 8
Joined: 1. Jun 2008, 07:28

Post by angadsingh »

Hi aribi, thanks for replying :)

There's a problem in the VBox.sh script in solaris, basically related with the positional parameters ($0..9) used. I fixed that by making these changes:

Code: Select all

APP=`which $0`
to..

Code: Select all

APP=`which $1`
and..

Code: Select all

    exec "$INSTALL_DIR/VBoxManage" $@
to..

Code: Select all

    exec "$INSTALL_DIR/VBoxManage" $2 $3 $4 $5 $6 $7 $8 $9
If I don't do this, it gives an error: cannot find VBoxManage, which basically means that the $@ parameter was sending all the arguments received by the VBox.sh scripts starting from "VBoxManage" to VBoxManage itself!

I made it to run.

Now, another thing I noticed was that the VirtualBox user manual only provides documentation for linux and windows as of now. It says that I need to tell it the disk device specification (for the entire disk). On linux it is /dev/sda and on windows it is \\.\PhysicalDrive0.

On solaris it is equivalent of /dev/rdsk/c5d0p0 (p0 refers to entire physical disk and not any specific partition)

Now I have encountered a virtualbox related problem:

Code: Select all

angad@opensolaris:/opt/VirtualBox# ./VBox.sh VBoxManage internalcommands createrawvmdk -filename /export/home/angad/windows.vmdk -rawdisk /dev/rdsk/c5d0p0 -register
VirtualBox Command Line Management Interface Version 1.5.51
(C) 2005-2008 innotek GmbH
All rights reserved.

Error while creating the raw disk VMDK: VERR_INVALID_PARAMETER
Any idea?
aribi
Posts: 36
Joined: 12. Apr 2008, 00:36

"Raw hard disk access" in Solaris

Post by aribi »

Hi angad,

Taking the risk again of pointing at the obvious again ;)
angad@opensolaris:/opt/VirtualBox# ./VBox.sh VBoxManage internalcommands createrawvmdk -filename /export/home/angad/windows.vmdk -rawdisk /dev/rdsk/c5d0p0 -register
Good point about cxdxp0, I learn something every day ;) But shouldn't that be /dev/dsk/... instead of /dev/rdsk: you'll want the random access device, not the character device.

About the VBox.sh script. I have the feeling this is just left over from previous version of VirtualBox. I seem to remember that under version 1.5.x the CLI commands where all symbolic links to this script. Then it makes sense that it tries to figure out how it was called. These things confirm the feeling of a "hasty and early" release of 1.6 for Solaris!
Instead of "./VBox.sh VBoxManage ...." you might just "./VBoxManage ..."

kind regards, Arie Bikker
angadsingh
Posts: 8
Joined: 1. Jun 2008, 07:28

Post by angadsingh »

Code: Select all

angad@opensolaris:/opt/VirtualBox# ./VBox.sh VBoxManage internalcommands createrawvmdk -filename /export/home/angad/windows.vmdk -rawdisk /dev/dsk/c5d0p0 -register
VirtualBox Command Line Management Interface Version 1.5.51
(C) 2005-2008 innotek GmbH
All rights reserved.

Error while creating the raw disk VMDK: VERR_INVALID_PARAMETER

Code: Select all

angad@opensolaris:/opt/VirtualBox# ./VBox.sh VBoxManage internalcommands createrawvmdk -filename /export/home/angad/windows.vmdk -rawdisk /dev/rdsk/c5d0p0 -register
VirtualBox Command Line Management Interface Version 1.5.51
(C) 2005-2008 innotek GmbH
All rights reserved.

Error while creating the raw disk VMDK: VERR_INVALID_PARAMETER

Code: Select all

angad@opensolaris:/opt/VirtualBox# ./VBoxManage internalcommands createrawvmdk -filename /export/home/angad/windows.vmdk -rawdisk /dev/rdsk/c5d0p0 -registerld.so.1: VBoxManage: fatal: VBoxDDU.so: open failed: No such file or directory
Killed
:(
aribi
Posts: 36
Joined: 12. Apr 2008, 00:36

"Raw hard disk access" in Solaris

Post by aribi »

Hi angad,

Should have noticed this before:
VirtualBox Command Line Management Interface Version 1.5.51
You might want to upgrade to 1.6

kind regards, Arie Bikker
angadsingh
Posts: 8
Joined: 1. Jun 2008, 07:28

Post by angadsingh »

Hey thanks a lot ! :)

I got it to work with VirtualBox 1.6 64-bit version!
gsporar
Posts: 9
Joined: 12. Mar 2008, 04:27

Post by gsporar »

>I got it to work with VirtualBox 1.6 64-bit version!

Great!

What exact command line syntax did you end up using?
angadsingh
Posts: 8
Joined: 1. Jun 2008, 07:28

Post by angadsingh »

Code: Select all

/VBox.sh VBoxManage internalcommands createrawvmdk -filename /export/home/angad/windows.vmdk -rawdisk /dev/dsk/c5d0p0 -register
works with the modifications I mentioned in the earlier post.
gsporar
Posts: 9
Joined: 12. Mar 2008, 04:27

Post by gsporar »

Hmmm... my disk drive has the same ID on my install of OpenSolaris 2008.05 as yours, so I am trying this command:

Code: Select all

 VBoxManage internalcommands createrawvmdk -filename /export/home/gs145266/fulldisk.vmdk -rawdisk /dev/dsk/c5d0p0 -register
and I get no result. The VBoxManage command just returns. No error is reported. But unfortunately, no file is created either.

Any ideas?
angadsingh
Posts: 8
Joined: 1. Jun 2008, 07:28

Post by angadsingh »

Please run it using the VBox.sh script, as it initializes some environment variables needed for VBoxManage and VirtualBox to run :)
gsporar
Posts: 9
Joined: 12. Mar 2008, 04:27

Post by gsporar »

>run it using the VBox.sh script

Turns out, that is what I have been doing all along, I just did not realize it.

Doing an ls -l, I see that VBoxManage is just a symlink to /opt/VirtualBox/VBox.sh.

So I'm stuck... no error message and no file gets created.

Any other suggestions?

Thanks.
angadsingh
Posts: 8
Joined: 1. Jun 2008, 07:28

Post by angadsingh »

Well thats a peculiar problem. From what I've understood, it might be because of an incompatible version. 64 bit version on 32 bit platform or vice versa? Otherwise, I really have no clue. No output ! Anyone else please tell us what is happening here?
gsporar
Posts: 9
Joined: 12. Mar 2008, 04:27

Post by gsporar »

>64 bit version on 32 bit platform or vice versa?

I don't think that is the problem. I installed the 64-bit version of VirtualBox, and isainfo -b reports:

64

So I'm stuck.
angadsingh
Posts: 8
Joined: 1. Jun 2008, 07:28

Post by angadsingh »

As per a thread on another alias, VirtualBox 1.6.2 should have 2 files:

VirtualBox userspace package:
VirtualBox-1.6.2-SunOS-amd64-r31466.pkg

VirtualBox kernel driver package:
VirtualBoxKern-1.6.2-SunOS-r31466.pkg

Do a pkgadd of both files (especially the second one) and see if it works.
Post Reply