Thursday Nov 06, 2008

kmdb in a Solaris VirtualBox Guest

How to enter the Solaris kernel debugger in a running virtual machine.
[Read More]

Wednesday Feb 13, 2008

32 bit Virtualbox and binary install help

Update --

VirtualBox for 32 bit x86 OpenSolaris host is now available for download at virtualbox.org

32 bit VirtualBox

My previous blog entry gave instructions for building a 64 bit version of VirtualBox on OpenSolaris. To get the 32 bit version some simple changes have to be applied to the instructions.

  • Do this on a system booted in 32 bit mode.
  • In the configure step for libqt, change "solaris-g++-64" to "solaris-g++".
  • Every place that says "/opt/qt64", should be "/opt/qt32" or whatever you'd rather use.

Binary Install Instructions

Also people have been asking for directions on how to install the 64 bit binary download for OpenSolaris available at virtualbox.org. This should work:

joe% gunzip VirtualBox-opensolaris-amd64-1.5.51-r28040-beta1.gz
joe% su
Password:
# pkgadd -d ./VirtualBox-opensolaris-amd64-1.5.51-r28040-beta1
...
# exit

Now you just need to modify your environment and run VirtualBox:

joe% setenv PATH /opt/VirtualBox:/opt/VirtualBox/qtgcc/bin:${PATH} 
joe% setenv LD_LIBRARY_PATH /opt/VirtualBox:/opt/VirtualBox/qtgcc/lib:${LD_LIBRARY_PATH} 
joe% VirtualBox

Tuesday Feb 12, 2008

VirtualBox on OpenSolaris

VirtualBox on OpenSolaris[Read More]

Wednesday Sep 19, 2007

Detecting Hardware Virtualization support for xVM

Yesterday, the xVM project team integrated the OpenSolaris code to enable using a Hypervisor on Solaris x64. This supports running multiple OS instances on a single box. If you want to run an operating system that has been paravirtualized, such as OpenSolaris or Linux, almost any CPU that supports regular OpenSolaris is good enough.

However to run an Operating System, say one from Microsoft, that hasn't been paravirtualized, you'll need a recent Intel or AMD CPU that contains hardware virtualization support and the BIOS in your system will have to enable (or not disable) that support.

The following Solaris program can be compiled and run to determine if HVM support will work when a system is booted under an xVM dom0. Note that this should be run when the system is not using the hypervisor.

/\*
 \* CDDL HEADER START
 \*
 \* The contents of this file are subject to the terms of the
 \* Common Development and Distribution License (the "License").
 \* You may not use this file except in compliance with the License.
 \*
 \* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
 \* or http://www.opensolaris.org/os/licensing.
 \* See the License for the specific language governing permissions
 \* and limitations under the License.
 \*
 \* When distributing Covered Code, include this CDDL HEADER in each
 \* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
 \* If applicable, add the following below this CDDL HEADER, with the
 \* fields enclosed by brackets "[]" replaced with your own identifying
 \* information: Portions Copyright [yyyy] [name of copyright owner]
 \*
 \* CDDL HEADER END
 \*/

/\*
 \* Test to see if Intel VT-x or AMD-v is supported according to cpuid.
 \*/
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <ctype.h>

static const char devname[] = "/dev/cpu/self/cpuid";

#define EAX     0
#define EBX     1
#define ECX     2
#define EDX     3

int
main(int argc, char \*\*argv)
{
        int device;
        uint32_t func;
        uint32_t regs[4];
        uint32_t v;
        int r;
        int bit;
        int nbits;

        /\*
         \* open cpuid device
         \*/
        device = open(devname, O_RDONLY);
        if (device == -1)
                goto fail;

        func = 0x0;
        if (pread(device, regs, sizeof (regs), func) != sizeof (regs))
                goto fail;

        if (regs[EBX] == 0x68747541 &&
            regs[ECX] == 0x444d4163 &&
            regs[EDX] == 0x69746e65) { /\* AuthenticAMD \*/

                func = 0x80000001;
                r = ECX;
                bit = 2;
                nbits = 1;

        } else if (regs[EBX] == 0x756e6547 &&
            regs[ECX] == 0x6c65746e &&
            regs[EDX] == 0x49656e69) { /\* GenuineIntel \*/

                func = 1;
                r = ECX;
                bit = 5;
                nbits = 1;

        } else {
                goto fail;
        }

        if (pread(device, regs, sizeof (regs), func) != sizeof (regs))
                goto fail;

        v = regs[r] >> bit;
        if (nbits < 32 && nbits > 0)
                v &= (1 << nbits) - 1;

        if (v)
                printf("yes\\n");
        else
                printf("no\\n");

        (void) close(device);
        exit(0);

fail:
        printf("no\\n");
        (void) close(device);
        exit(1);
}

About

JoeBonasera

Search

Categories
Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
   
       
Today
News

No bookmarks in folder

Blogroll

No bookmarks in folder