Wednesday, March 09, 2011

How to headless solaris on a windows box =revisited =

1. Somehow you have a solaris cd install

2. Get virtualbox and install. http://www.virtualbox.org/wiki/Downloads

3. Configure vm in virtualbox, quite straightforward. For network configuration, choose bridged adapter and choose your pc NIC (this is to let you ssh into your vm)

4. Add the solaris iso into the storage setting so it loads during startup.

5. Starts vm. Install solaris from the mounted iso. It will auto reboot if you choose to, when it finish installing.

6. Boot solaris and disable gui.

To disable the GUI startup: /usr/dt/bin/dtconfig -d
And, to enable it again: /usr/dt/bin/dtconfig -e

7.Enable root login through ssh. (stupid, i know)
(i just grep it to show you how it looks like, after edit restart ssh)

bash-3.2# grep PermitRoot /etc/ssh/sshd_config
PermitRootLogin yes
bash-3.2#
bash-3.2# svcadm restart network/ssh:default
bash-3.2#


8.Configure static network http://facti.net/drupal/node/87

# tail /etc/hosts
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
192.168.1.5 solar loghost

# tail /etc/inet/ipnodes
# Copyright 2006 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
192.168.1.5 solar loghost

# tail /etc/nodename
solar

bash-3.2# tail /etc/solar.e1000g0
solar

##this make sure the dns resolve work
bash-3.2# cp /etc/nsswitch.dns /etc/nsswitch.conf
bash-3.2# ping google.com
google.com is alive
bash-3.2#

add your workstation ip and name in your Sun box /etc/hosts file (solve ssh password prompt hang issue)

# tail /etc/hosts
# Use is subject to license terms.
#
# ident "%Z%%M% %I% %E% SMI"
#
# Internet host table
#
::1 localhost
127.0.0.1 localhost
192.168.1.5 solar loghost
192.168.1.2 queenofblade
#




9.Shutdown ( or restart network just to test your setting work first)

bash-3.2# svcadm restart network/physical:default
bash-3.2#

bash-3.2# ifconfig -a
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL> mtu 8232 index 1
inet 127.0.0.1 netmask ff000000
e1000g0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
inet 192.168.1.5 netmask ffffff00 broadcast 192.168.1.255
ether 8:0:27:14:a9:29
lo0: flags=2002000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv6,VIRTUAL> mtu 8252 index 1
inet6 ::1/128
bash-3.2#

bash-3.2# netstat -rn

Routing Table: IPv4
Destination Gateway Flags Ref Use Interface
-------------------- -------------------- ----- ----- ---------- ---------
192.168.1.0 192.168.1.5 U 1 1 e1000g0
127.0.0.1 127.0.0.1 UH 1 0 lo0

Routing Table: IPv6
Destination/Mask Gateway Flags Ref Use If
--------------------------- --------------------------- ----- --- ------- -----
::1 ::1 UH 1 21 lo0
bash-3.2#
bash-3.2# dladm show-link
LINK CLASS MTU STATE OVER
e1000g0 phys 1500 up --
bash-3.2#

shutdown -y -i5 -g0


10. get vboxvmservice.sourceforge.net. This is so you can run the server in headless mode, without the virtualbox gui. Read the how-to in doc folder. Please reboot your windows after configuring the VBoxVmService.ini. By default, vboxvmservice starts every vm in VBoxVMService.ini when you starts the service. With the latest revision
http://vboxvmservice.svn.sourceforge.net/viewvc/vboxvmservice/ , you can set whether you want the vm to be auto start or not.

##sample .ini
[Settings]
ServiceName=VBoxVmService
VBOX_USER_HOME=C:\Users\zeratul\.VirtualBox
PauseShutdown=5000

[Vm0]
VmName=solar
WorkingDir=E:\leech\VBoxVmService-2.2-Fireworks\vms
ShutdownMethod=savestate
VrdePort=3001

11. install and start vboxvmservice. start vm from the cmd. ( i skip the install and start part)

C:\Users\zeratul>cd E:\leech\VBoxVmService-2.2-Fireworks\vms

C:\Users\zeratul>e:

E:\leech\VBoxVmService-2.2-Fireworks\vms>VmServiceControl.exe
VBoxVmSerice control utility
usage: VmServiceControl [options]
-i Install VBoxVmService service
-u Uninstall VBoxVmService service
-s Start VBoxVmService service
-k Stop VBoxVmService service
-b Restart VBoxVmService service
-e Print service environment
-su n Startup VM with index n
-sd n Shutdown VM with index n
-st n Show status for VM with index n
-sp n Show guest properties if Guest Additions are installed
for VM with index n

E:\leech\VBoxVmService-2.2-Fireworks\vms>VmServiceControl.exe -s
StartService failed: An instance of the service is already running.

E:\leech\VBoxVmService-2.2-Fireworks\vms>VmServiceControl.exe -su 0
Read 2866 bytes
Started your virtual machine, VM0

Name: solar
Guest OS: Oracle Solaris 10 10/09 and later
UUID: ca27e1b2-cc15-4abd-93b5-e47e5ae1c35a
Config file: C:\Users\zeratul\VirtualBox VMs\solar\solar.vbox
Snapshot folder: C:\Users\zeratul\VirtualBox VMs\solar\Snapshots
Log folder: C:\Users\zeratul\VirtualBox VMs\solar\Logs
Hardware UUID: ca27e1b2-cc15-4abd-93b5-e47e5ae1c35a
Memory size: 1024MB
Page Fusion: off
VRAM size: 12MB
HPET: off
Chipset: piix3
Firmware: BIOS
Number of CPUs: 1
Synthetic Cpu: off
CPUID overrides: None
Boot menu mode: message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI: on
IOAPIC: off
PAE: off
Time offset: 0 ms
RTC: local time
Hardw. virt.ext: on
Hardw. virt.ext exclusive: off
Nested Paging: on
Large Pages: on
VT-x VPID: on
State: running (since 2011-03-09T14:42:39.642000000)
Monitor count: 1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Storage Controller Name (0): SATA Controller
Storage Controller Type (0): IntelAhci
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0): 30
Storage Controller Port Count (0): 30
Storage Controller Bootable (0): on
SATA Controller (0, 0): C:\Users\zeratul\VirtualBox VMs\solar\solar.vdi (UUID: 5
2f4f312-f325-4362-8cbf-3fc58aad3cb1)
SATA Controller (1, 0): C:\PROGRA~1\Oracle\VIRTUA~1\VBoxGuestAdditions.iso (UUID
: beaca415-3297-4c13-a62b-c40aeeacc7e2)
NIC 1: MAC: 08002714A929, Attachment: Bridged Interface 'Realtek PCIe
GBE Family Controller', Cable connected: on, Trace: off (file: none), Type: 8254
0EM, Reported speed: 0 Mbps, Boot priority: 0
NIC 2: disabled
NIC 3: disabled
NIC 4: disabled
NIC 5: disabled
NIC 6: disabled
NIC 7: disabled
NIC 8: disabled
Pointing Device: USB Tablet
Keyboard Device: PS/2 Keyboard
UART 1: disabled
UART 2: disabled
Audio: enabled (Driver: DSOUND, Controller: AC97)
Clipboard Mode: Bidirectional
Video mode: 720x400x0
VRDE: enabled (Address 0.0.0.0, Ports 3001, MultiConn: off, ReuseSing
leConn: off, Authentication type: null)
Video redirection: disabled
USB: enabled

USB Device Filters:



Available remote USB devices:



Currently Attached USB Devices:



Shared folders:

VRDE Connection: not active
Clients so far: 0

Guest:

OS type: OpenSolaris
Additions run level: 0
Configured memory balloon size: 0 MB

E:\leech\VBoxVmService-2.2-Fireworks\vms>VmServiceControl.exe -st 0
Read 2866 bytes
Status for your virtual machine, VM0

Name: solar
Guest OS: Oracle Solaris 10 10/09 and later
UUID: ca27e1b2-cc15-4abd-93b5-e47e5ae1c35a
Config file: C:\Users\zeratul\VirtualBox VMs\solar\solar.vbox
Snapshot folder: C:\Users\zeratul\VirtualBox VMs\solar\Snapshots
Log folder: C:\Users\zeratul\VirtualBox VMs\solar\Logs
Hardware UUID: ca27e1b2-cc15-4abd-93b5-e47e5ae1c35a
Memory size: 1024MB
Page Fusion: off
VRAM size: 12MB
HPET: off
Chipset: piix3
Firmware: BIOS
Number of CPUs: 1
Synthetic Cpu: off
CPUID overrides: None
Boot menu mode: message and menu
Boot Device (1): Floppy
Boot Device (2): DVD
Boot Device (3): HardDisk
Boot Device (4): Not Assigned
ACPI: on
IOAPIC: off
PAE: off
Time offset: 0 ms
RTC: local time
Hardw. virt.ext: on
Hardw. virt.ext exclusive: off
Nested Paging: on
Large Pages: on
VT-x VPID: on
State: running (since 2011-03-09T14:42:39.642000000)
Monitor count: 1
3D Acceleration: off
2D Video Acceleration: off
Teleporter Enabled: off
Teleporter Port: 0
Teleporter Address:
Teleporter Password:
Storage Controller Name (0): SATA Controller
Storage Controller Type (0): IntelAhci
Storage Controller Instance Number (0): 0
Storage Controller Max Port Count (0): 30
Storage Controller Port Count (0): 30
Storage Controller Bootable (0): on
SATA Controller (0, 0): C:\Users\zeratul\VirtualBox VMs\solar\solar.vdi (UUID: 5
2f4f312-f325-4362-8cbf-3fc58aad3cb1)
SATA Controller (1, 0): C:\PROGRA~1\Oracle\VIRTUA~1\VBoxGuestAdditions.iso (UUID
: beaca415-3297-4c13-a62b-c40aeeacc7e2)
NIC 1: MAC: 08002714A929, Attachment: Bridged Interface 'Realtek PCIe
GBE Family Controller', Cable connected: on, Trace: off (file: none), Type: 8254
0EM, Reported speed: 0 Mbps, Boot priority: 0
NIC 2: disabled
NIC 3: disabled
NIC 4: disabled
NIC 5: disabled
NIC 6: disabled
NIC 7: disabled
NIC 8: disabled
Pointing Device: USB Tablet
Keyboard Device: PS/2 Keyboard
UART 1: disabled
UART 2: disabled
Audio: enabled (Driver: DSOUND, Controller: AC97)
Clipboard Mode: Bidirectional
Video mode: 720x400x0
VRDE: enabled (Address 0.0.0.0, Ports 3001, MultiConn: off, ReuseSing
leConn: off, Authentication type: null)
Video redirection: disabled
USB: enabled

USB Device Filters:



Available remote USB devices:



Currently Attached USB Devices:



Shared folders:

VRDE Connection: not active
Clients so far: 0

Guest:

OS type: OpenSolaris
Additions run level: 0
Configured memory balloon size: 0 MB




E:\leech\VBoxVmService-2.2-Fireworks\vms>

12. ssh to vm. Finished! (get putty or something)

bash-3.2# uname -a;date;uptime
SunOS solar 5.11 snv_122 i86pc i386 i86pc
Wed Mar 9 23:57:14 MYT 2011
11:57pm up 1:14, 1 user, load average: 0.04, 0.03, 0.04
bash-3.2#


13. HOHO

###############
extra notes:
http://www.idevelopment.info/data/Unix/Solaris/SOLARIS_ConfiguringApropos.shtml
http://www.marksanborn.net/howto/bypass-firewall-and-nat-with-reverse-ssh-tunnel/
http://lildude.co.uk/what-do-all-the-services-on-solaris-10-do

No comments:

Post a Comment