"Raw hard disk access" in Solaris

Discussions related to using VirtualBox on Solaris hosts.
gsporar
Posts: 9
Joined: 12. Mar 2008, 04:27

Post by gsporar »

Thanks, but, I already have both packages installed. - Gregg

gs145266@opensolaris-gs-08.05:~$ pkginfo -l SUNWvbox
PKGINST: SUNWvbox
NAME: Sun xVM VirtualBox
CATEGORY: application
ARCH: i386
VERSION: 1.6.2,REV=2008.05.31.04.05
BASEDIR: /
VENDOR: Sun Microsystems, Inc.
DESC: A powerful PC virtualization solution
PSTAMP: vbox20080531040521
INSTDATE: Jun 12 2008 03:46
HOTLINE: Please contact your local service provider
EMAIL: info@virtualbox.org
STATUS: completely installed

gs145266@opensolaris-gs-08.05:~$ pkginfo -l SUNWvboxkern
PKGINST: SUNWvboxkern
NAME: Sun xVM VirtualBox Kernel Interface Module
CATEGORY: system
ARCH: i386
VERSION: 1.6.2,REV=2008.05.31.04.04
BASEDIR: /
VENDOR: Sun Microsystems, Inc.
DESC: Sun xVM VirtualBox kernel interface module (vbi) for SunOS 32-bit and 64-bit
PSTAMP: vboxkern20080531040440
INSTDATE: Jun 12 2008 03:46
HOTLINE: Please contact your local service provider
EMAIL: info@virtualbox.org
STATUS: completely installed
milosh
Posts: 5
Joined: 16. Jun 2008, 21:15

Post by milosh »

I have exactly the same problem with SXDE snv_82. The VBoxManage under Solaris does simply nothing. Fortunately I have a dual boot WinXP/Solaris on my harddrive, so I have installed VirtualBox under Windows. VBoxManage under Windows performs better, createrawvmdk command works and creates vmdk file. So I have created vmdk file with rawdisk \\.\PhysicalDrive0 options. This couldn't be used in Solaris, so I have replaced it with /dev/dsk/c1d0p0 in created vmdk file.
Whole command in Windows is:

VBoxManage internalcommands createrawvmdk -rawdisk \\.\PhysicalDrive0 -partitions 1,5 -filename winaccess.vmdk -mbr fakembr.txt

The purpose of fakembr.txt is to replace the original MBR, so the virtual Windows cannot see Solaris partitions. Unfortunately this options didn't work, so I had to edit directly winaccess-pt.vmdk in hex editor. I have deleted the records for two Solaris partitions in MBR.

Finally I have booted to Solaris, used my winaccess.vmdk and winaccess-pt.vmdk files created in Windows and assigned it to IDE Primary master. It works! I can access real NTFS partitions from virtual Windows! The space for Solaris is reported as unallocated space due to changes in MBR.

So now I don't need either ntfsprogs or fuse to access NTFS :) BTW has anyone managed to compile fuse-3g under Solaris/OpenSolaris?
gsporar
Posts: 9
Joined: 12. Mar 2008, 04:27

Post by gsporar »

Thanks for the tip - that worked for me, although I used Ubuntu 8.04 as the host operating system in order to get VBoxManage to work. And I changed the entry in my file to fit my hardware with /dev/dsk/c5d0p0. :-)

In the end, it was all for nothing - attempting to boot the natively-installed Ubuntu 8.04 in a virtual machine did not work because of an fsck error on startup. :-/ But that is a topic for another thread.
Tomservo
Posts: 34
Joined: 13. Feb 2008, 13:42
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Solaris Express 11

Post by Tomservo »

milosh wrote: So now I don't need either ntfsprogs or fuse to access NTFS :) BTW has anyone managed to compile fuse-3g under Solaris/OpenSolaris?
Haven't tried in a long time, but I remember that the developers of the Solaris port posted patches a while ago to make it compile. I think they're on the project page or the mailing list.
gsporar
Posts: 9
Joined: 12. Mar 2008, 04:27

Post by gsporar »

Angad, when you were able to get this command to work on OpenSolaris 2008.05:


[code]/VBox.sh VBoxManage internalcommands createrawvmdk -filename /export/home/angad/windows.vmdk -rawdisk /dev/dsk/c5d0p0 -register[/code]

Were you using VirtualBox 1.6 or VirtualBox 1.6.2?

The reason I ask is because of this post by klaus over in a similar thread: http://forums.virtualbox.org/viewtopic. ... 8333#28333
jkeil
Posts: 80
Joined: 5. Jun 2008, 16:12

Post by jkeil »

gsporar wrote:Angad, when you were able to get this command to work on OpenSolaris 2008.05:

Code: Select all

/VBox.sh VBoxManage internalcommands createrawvmdk -filename /export/home/angad/windows.vmdk -rawdisk /dev/dsk/c5d0p0 -register
Were you using VirtualBox 1.6 or VirtualBox 1.6.2?

The reason I ask is because of this post by klaus over in a similar thread: http://forums.virtualbox.org/viewtopic. ... 8333#28333
Creating raw vmdk files is broken on Solaris, upto and including VirtualBox 1.6.2

This is defect #1784:

http://www.virtualbox.org/ticket/1784
gsporar
Posts: 9
Joined: 12. Mar 2008, 04:27

Post by gsporar »

>This is defect #1784:
> http://www.virtualbox.org/ticket/1784

Yes, I am familiar with defect #1784 - I filed it. :-) That is why I am trying to get clarification from Angad on exactly what environment he was using when he got this to work. Based on what I know, it sounds like the software does not yet support what Angad was somehow able to accomplish.
jkeil
Posts: 80
Joined: 5. Jun 2008, 16:12

Post by jkeil »

> That is why I am trying to get clarification from Angad on exactly what environment he was using when he got this to work.

Angad seems to be using VirtualBox 1.6.0.

And in the other thread, user klaus said that 1.6.2 was changed to use an ioctl() call
to find out the size of the raw device, and before 1.6.2 they apparently used a stat() call.
Now ioctl() works on Solaris character devices, but it doesn't work with block devices.
Unfortunately, VBoxManage requires that you use a block device with createrawvmdk.

For me, in the past, VBoxManage internalcommands createrawvmdk never worked
(it always completed without error message, but didn't create the vmdk file).
But I didn't try to find out why it was failing, until I tried 1.6.2.


Using a debugger I was able to get past the block device check when using a character
device with VBoxManage internalcommands createrawvmdk, and that allowed it to
create the vmdk file.
Tomservo
Posts: 34
Joined: 13. Feb 2008, 13:42
Primary OS: MS Windows 7
VBox Version: PUEL
Guest OSses: Solaris Express 11

Post by Tomservo »

With 1.6.0 I created VMDKs with character devices and it didn't seem to be bothered. The same VMDKs still work with with 1.6.2, just creation doesn't work anymore.
sp0oky
Posts: 1
Joined: 11. Sep 2008, 01:40

Post by sp0oky »

Here's what I have installed:

Code: Select all

spooky@blazed:~# pkginfo -l SUNWvbox
   PKGINST:  SUNWvbox
      NAME:  Sun xVM VirtualBox
  CATEGORY:  application
      ARCH:  i386
   VERSION:  2.0.0,REV=2008.09.03.20.46
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  A powerful PC virtualization solution
    PSTAMP:  vbox20080903204640
  INSTDATE:  Sep 05 2008 15:39
   HOTLINE:  Please contact your local service provider
     EMAIL:  info@virtualbox.org
    STATUS:  completely installed

spooky@blazed:~# pkginfo -l SUNWvboxkern
   PKGINST:  SUNWvboxkern
      NAME:  Sun xVM VirtualBox Kernel Interface Module
  CATEGORY:  system
      ARCH:  i386
   VERSION:  2.0.0,REV=2008.09.03.20.46
   BASEDIR:  /
    VENDOR:  Sun Microsystems, Inc.
      DESC:  Sun xVM VirtualBox kernel interface module (vbi) for SunOS 32-bit and 64-bit
    PSTAMP:  vboxkern20080903204632
  INSTDATE:  Sep 05 2008 15:39
   HOTLINE:  Please contact your local service provider
     EMAIL:  info@virtualbox.org
    STATUS:  completely install
When I try to create the vmdk file with this line:

Code: Select all

spooky@blazed:~# VBoxManage internalcommands createrawvmdk -filename /export/home/spooky/windows.vmdk -rawdisk /dev/dsk/c5d0p0 -register
VirtualBox Command Line Management Interface Version 2.0.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

Error getting the size of the raw disk '/dev/dsk/c5d0p0': VERR_INVALID_FUNCTION
The raw disk vmdk file was not created

If I try /dev/rdsk instead of /dev/dsk, It creates the file but dumps with a segmentation fault:

Code: Select all

spooky@blazed:~# VBoxManage internalcommands createrawvmdk -filename /export/home/spooky/windows.vmdk -rawdisk /dev/rdsk/c5d0p0 -register
VirtualBox Command Line Management Interface Version 2.0.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

Segmentation Fault (core dumped)
One more try:

Code: Select all

spooky@blazed:~# VBoxManage internalcommands createrawvmdk -filename /export/home/spooky/windows.vmdk -rawdisk /dev/rdsk/c5d0p0 -partitions 1
VirtualBox Command Line Management Interface Version 2.0.0
(C) 2005-2008 Sun Microsystems, Inc.
All rights reserved.

Segmentation Fault (core dumped)
When I add the partitions instead of register it makes two files, windows.vmdk and windows-pt.vmdk.
Neither of which boot up in virtualbox.

The content of the file windows.vmdk:

Code: Select all

# Disk DescriptorFile
version=1
CID=2493d1a6
parentCID=ffffffff
createType="partitionedDevice"

# Extent description
RW 2048 FLAT "windows-pt.vmdk"
RW 248518656 FLAT "/dev/rdsk/c5d0p0" 2048
RW 142186496 ZERO 
RW 9728 ZERO 

# The disk Data Base 
#DDB

ddb.virtualHWVersion = "4"
ddb.adapterType="ide"
ddb.geometry.cylinders="16383"
ddb.geometry.heads="16"
ddb.geometry.sectors="63"
ddb.uuid.image="8f0ae105-5527-4aba-b958-f2c4c5f26e3f"
ddb.uuid.parent="00000000-0000-0000-0000-000000000000"
ddb.uuid.modification="00000000-0000-0000-0000-000000000000"
ddb.uuid.parentmodification="00000000-0000-0000-0000-000000000000"


I'm running dual boot, Vista Home Premium 32-bit /OpenSoalris Express 5.11 x86_64 *build 86 (been trying to upgrade to a more recent build but I keep winding up having to reload the OS :( ).
Maybe I'd be better off making Vista the host and solaris the guest, but I'd rather run the 64-bit OS full time.
I just like compiz too much ;)
jgmdean
Posts: 2
Joined: 12. Sep 2008, 19:15

Post by jgmdean »

I'm running VBox 2.0.0 under OpenSolaris 2008.05 snv_97.

I did the createravrmdk with the /dev/rdsk It created the file and dumped core.

I edited the .vmdk file and changed the rdsk to dsk.

VBox seems quite happy to add and use this file, and I just installed an OS onto the raw whole disk.

All of this was done as the "real" root user, not pfexec.

James
kebabbert
Volunteer
Posts: 321
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

[SOLVED] Re: "Raw hard disk access" in Solaris

Post by kebabbert »

A quick question; those of you who succeeded with accessing a NTFS partition from Virtualbox, what transfer speeds do you get?

When I use NTFS drivers for Solaris, I get like 3mb/sec. Can you copy a large file faster than 3mb/sec?



EDIT: This command worked for me, v4.1.0. Using Solaris 11 Express as host. I am using Windows as a partition, and not whole disk. So I need to specify which partition ("-partitions 1") to use. Do this as root:
# VBoxManage internalcommands createrawvmdk -filename /mnt/Storage/Everything/Win7.vmdk -rawdisk /dev/rdsk/c8t5d0p0 -partitions 1
RAW host disk access VMDK file /mnt/Storage/Everything/Win7.vmdk created successfully.

I can see which partitions are on my system with
# VBoxManage internalcommands listpartitions -rawdisk /dev/rdsk/c8t5d0p0




EDIT 2: Then I must start VirtualBox as root. I do that with "pfexec VirtualBox" and the VB window pops up. I install WinXP and then add a hard disk to the WinXP VM, by using "Settings - Storage - IDEController" and press the "+" button. I add the same file I created above (Win7.vmdk), and when I boot the WinXP, I can access my raw NTFS disk. So everything works now, I can access a raw NTFS disk from VB.




EDIT 3: I get 8MB/sec transfer speeds when I use virtualized WinXP inside VB v4.1.0 to access a raw NTFS disk, and I copy a file from NTFS raw disk to a Solaris partition on the same disk. Which kinda sucks. Is it possible to make it faster?




EDIT 4: When I copy from Solaris to NTFS raw disk (on the same disk) I get 10-15MB/Sec which is better. But still it is slow.

My disk has two partitions: NTFS and Solaris ZFS.
Last edited by kebabbert on 25. Jul 2011, 14:37, edited 2 times in total.
kebabbert
Volunteer
Posts: 321
Joined: 31. May 2008, 10:00
Primary OS: OpenSolaris 11
VBox Version: OSE other
Guest OSses: WinXP, RedHat, Ubuntu

Re: "Raw hard disk access" in Solaris

Post by kebabbert »

Ok, if I use a Win7 guest to access the NTFS raw partition, I reach 20MB/sec. This is better than WinXP, but still it is slow.
Post Reply