Thursday May 07, 2009
Automated Install using Virtual Box
These are the notes I wrote while setting up an AI server test bed using Virtual Box. The configuration consists of two Virtual Box clients running on a single host.
The host must have at least 4gb RAM. I configured each client with 1gb of RAM. One of the Virtual Machines acts as the AI server the other as the client. The one acting as the server is configured with two network interfaces, one NAT and one on a Virtual Box internal network. The Virtual Machine to act as the install client is configured with only one network interface on the same Virtual Box internal network as the server.
http://dlc.sun.com/osol/docs/content/2008.11/AIinstall/gentextid-140.html http://www.opensolaris.org/os/project/caiman/auto_install/AI_install_server_setup.html Information on Virtual Box can be found at: http://www.virtualbox.org/
One Virtual Box VM for the AI server. - I used host name "ais": - Network adapter configuration: Adapter 1: Intel PRO/1000 MT Desktop (NAT) Adapter 2: Intel PRO/1000 MT Desktop (internal network, 'AI') - 1024mb RAM One Virtual Box VM for the AI server. One for an AI client (aic) with: - I used host name "aic": - Network adapter configuration: Adapter 1: Intel PRO/1000 MT Desktop (internal network, 'AI') - 1024mb RAM
A: Install OSOL For instructions on installing OSOL look here: http://opensolaris.org/os/newbies/ B: Install and confirm the needed Auto Installer packages on AI server
Set the package publisher accordingly for the desired version.
Note The pkg subcommand has changed from using the term authority to publisher in version 2009.06. If using an older version one may need to use the command pkg set-authority where pkg set-publisher is used in the examples.
% pkg set-publisher -O http://pkg.opensolaris.org/dev \ opensolaris.org OR % pkg set-publisher -O http://ipkg.sfbay/dev opensolaris.org Install the needed packages % pkg install SUNWinstalladm-tools Confirm the needed packages have been installed % pkg list | cat > ./pkg_list.out % grep SUNWdhcs ./pkg_list.out % grep SUNWdhcm ./pkg_list.out % grep SUNWtftp ./pkg_list.out % grep SUNWapch22 ./pkg_list.out % grep SUNWdsd ./pkg_list.out % grep SUNWsqlite3 ./pkg_list.out % grep SUNWpysqlite ./pkg_list.out % grep SUNWpython-cherrypy ./pkg_list.out % grep SUNWpython-lxml ./pkg_list.out C: Configure the AI server Configure /etc/hosts Setup the host name of the AI install server and the clients to be installed in the /etc/hosts file. % tail -10 /etc/hosts # #::1 ais ais.local localhost loghost #127.0.0.1 ais ais.local localhost loghost 10.0.2.15 ais ais.local 192.168.168.100 ais_private ais_private.local 192.168.168.151 client1 192.168.168.152 client2 192.168.168.153 client3 192.168.168.154 client4 192.168.168.155 client5 Configure DNS and router information Ensure that /etc/resolv.conf is populated with correct DNS information on the server e.g.: % cat /etc/resolv.conf domain East.Sun.COM nameserver 10.0.2.3 Ensure that your name service is DNS Do this by checking /etc/nsswitch.conf. It should have dns for hosts and IP nodes. % grep ^hosts /etc/nsswitch.conf % grep ^ipnodes /etc/nsswitch.conf Ensure that the DNS client SMF service /network/dns/client:default is enabled. % svcs | grep dns\/client online 12:44:41 svc:/network/dns/client:default Ensure the default router is set. % netstat -rn | grep default default 10.0.2.2 UG 1 40 e1000g0 % echo 10.0.2.2 > /etc/defaultrouter
Because the AI cliet is on the Virtual Box Internal Network it can not access the Internet, which it will need to do in order to download IPS packages. However because the AI server has an external interface and also an interface on the Virtual Box Internal Network it can be configured to act as a NAT for the AI client. [1] configure the interfaces I let DHCP configure the external NIC1 (e1000g0) * NIC1 (e1000g0) using NAT % touch /etc/dhcp.e1000g0 % echo "" > /etc/hostname.e1000g0 I assign an address to the internal network. (ais_private was added to /etc/hosts above) * NIC2 (e1000g1) using Internal Network % rm /etc/dhcp.e1000g1 % echo ais_private > /etc/hostname.e1000g1 Make sure netmasks is correct for the external, 10., network and the internal 192.168 network: % tail /etc/netmasks 10.0.0.0 255.255.255.0 192.168.168.0 255.255.255.0 [2] enable packet forwarding % routeadm -e ipv4-forwarding % routeadm -u % routeadm [3] configure NAT % echo "map e1000g0 192.168.168.0/24 -> 0/32" > \ /etc/ipf/ipnat.conf Where: e1000g0 - public netowrk interface 192.168.50.0/24 - address of private net [4] enable packet filtering/NAT % svcadm enable network/ipfilter
I used the latest development image available internally to Sun But externally from Sun the image are available at: http://www.opensolaris.com/get/index.jsp The command I used to get the latest Sun internal development image: % /usr/sfw/bin/wget \ ftp://nana.sfbay/products/osol_0906/111/osol-0906-111-ai-x86.iso &
The dhcp-server manifest is not being imported when the dhcp packages are being installed. So it must be done manually. % svccfg import /var/svc/manifest/network/dhcp-server.xml
Create an install service by running 'installadm create-service' as follows: % installadm create-service -n svcAI \ -i 192.168.168.151 \ -c 5 \ -s /var/tmp/ISO_IMAGES/osol-0906-111-ai-x86.iso \ /server/images/osol-0906-111-ai The above command will do the following things - Create a net image at /server/images/osol-0906-111-ai using the AI image passed in the option -s - Start a install service with the name 'svcAI'. - Create a DHCP server, setup a macro and setup 5 addresses starting from 192.168.168.151 - Create the necessary bootfile and lofimounts, web server links for the client to boot
For more information see the section "How to change or replace the default manifest?" here:
http://www.opensolaris.org/os/project/caiman/auto_install/AI_manifest_setup.html
What I did is as follows:
1. Copy the default manifest from the target image path associated with the service. The target imagepath associated with a service can be determined with the following command:
svccfg -s :/system/install/server:default listprop AI<svcname>/image_path
For example:% svccfg -s :/system/install/server:default listprop AIsvcAI/image_path
AIsvcAI/image_path astring /export/aiserver/svcAI
In the above example, svc1's imagepath is /export/aiserver/svc1. The default manifest located in this imagepath is at: /export/aiserver/svcAI/auto_install/default.xml
Note: Only services created with 2009.06 images will contain the a default.xml manifest file in the imagepath. For services created with older images, you can use the default.xml manifest located on the server located at: /usr/share/auto_install/default.xml
2. The <ai_manifest name> tag in your manifest copy must keep the value of “default”.
3. Revise the <ai_embedded_manifest> and <sc_embedded_manifest> sections of your copy as needed.
e.g. To change the pkg publisher
% cp /export/aiserver/svcAI/auto_install/default.xml /var/tmp
vim /var/tmp/default.xml
I change the pkg publisher to use the Sun internal development one.
% grep ipkg /var/tmp/default.xml
<main url="http://ipkg.sfbay/dev" authname="opensolaris.org"/>
4. Use the installadm add command to replace the default manifest for an existing service with your copy as follows:
# /usr/sbin/installadm add -m manifest_file -n svc_name
Where manifest_file is the name of your manifest copy and svc_name is the name of the service. The installadm add command validates your manifest before replacing the default manifest.
For Example:
# /usr/sbin/installadm add -m /var/tmp/default.xml -n svcAI
browse to URL: http://localhost:5555/ . If it is not running start the apache web server. /usr/apache2/2.2/bin/apachectl \ -f /var/installadm/ai-webserver/ai-httpd.conf \ -k start
% /usr/sadm/admin/bin/dhcpmgr & This command starts a GUI. Using the GUI confirm: In macro dhcp_macro_svcAI: "BootSrvA" is set to the ais_privet address: 192.168.168.100 In macro 192.168.168.0 "router" is set to ais_privet address: 192.168.168.100 Restart the DHCP server if needed % svcadm restart dhcp-server:default
% /usr/bin/svcs | grep tftp
Configure the Virtual Box AI Client Virtual Machine to boot from the network and boot it. (Virtual Machine preferences/advance/boot set it to network) This will install the default configuration. For setting up different manifests other than the default refer to Automated Installer Manifests.
Enable ssh: Enable ssh to allow more windows, besides the console, to track progress. % /lib/svc/method/sshd -c % svcadm enable ssh Monitor the log files: % tail -f /tmp/install_log % tail -f /tmp/ai_sd_log % tail -f /var/svc/log/application-auto-installer\:default.log To monitor progress I suggest monitoring this log file during installation: % /var/svc/log/application-auto-installer\:default.log
The VirtualBox Client is configured to boot from the network. This must be reconfigured to boot from the installed virtual disk. - shutdown - Change VB settings for AI Client to boot from hard disk - Start VB AI client
Posted at 10:55AM May 07, 2009 by Joseph Vlcek in Personal | Comments[1]
Friday March 13, 2009
How to bypass boot splash screen
As of our 2008.11 release when an installation of OpenSolaris boots a graphical "splash screen", AKA "Happy Face" boot is presented.
It would be nice to be able to interrupt this and see the boot text message but this ability wasn't ready when 2008.11 shipped. It will be for the summer 2009 release.
One way to mitigate this is to provide a GRUB menu.lst file entry to provide a "text boot". However pkg image-update does not copy this "text boot" entry. So it won't be available for new Boot Environments (BEs).
Here is how to manually update the GRUB menu.lst file to add a "text boot" entry for a BE.
1. Duplicate the BE GRUB entry.title opensolaris-32. From one of the entries remove the following 3 lines:
findroot (pool_rpool,0,a)
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
bootfs rpool/ROOT/opensolaris-3
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/$ISADIR/boot_archive
title opensolaris-3
findroot (pool_rpool,0,a)
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
bootfs rpool/ROOT/opensolaris-3
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/$ISADIR/boot_archive
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
e.g.:
Change From:
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
To:
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
# BE opensolaris-3 with boot splash screen
title opensolaris-3
findroot (pool_rpool,0,a)
splashimage /boot/solaris.xpm
foreground d25f00
background 115d93
bootfs rpool/ROOT/opensolaris-3
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=graphics
module$ /platform/i86pc/$ISADIR/boot_archive
# BE opensolaris-3 without the boot splash screen
title opensolaris-3 text boot
findroot (pool_rpool,0,a)
bootfs rpool/ROOT/opensolaris-3
kernel$ /platform/i86pc/kernel/$ISADIR/unix -B $ZFS-BOOTFS
module$ /platform/i86pc/$ISADIR/boot_archive
Posted at 11:42AM Mar 13, 2009 by Joseph Vlcek in Personal | Comments[0]
Friday March 06, 2009
Hello - and NVIDIA issues with build 108
This is my first attempt at blog. I never thought anyone would care to hear my rantings. But I tend to write notes on how I manage to get over obstacles. A coworker suggested I post one note as a blog. So here I go... The first turn down the bump run...
I hope my blog entries can prevent others from hitting a tree.
More information on NVIDIA issues with 108 can be found here:
http://www.opensolaris.org/jive/thread.jspa?threadID=83421&tstart=-3
Below are my notes for what I did to get my dual monitors on the NVIDIA card working.
To fix dual monitors on the NVIDIA card, use the legacy NVIDIA drivers
1. Remove the newer NNVIDIA bits:
$ pfexec pkg uninstall slim_install
$ pfexec pkg uninstall NVDAgraphics
2. Download the legacy NVIDIA drivers
From:
http://www.nvidia.com/object/unix.html
Get:
Solaris x64/x86
Latest Legacy GPU version (173.14.xx series):
173.14.12
Follow instructions to install.
3. Reboot
Do not simply restart X. One must reboot.
4. Using the desktop tool to create the xorg.conf file:
Select from the little GNOME foot:
System Tools/NVIDIA X Server Setting
The first time the tool is run it may indicate
no xorg.conf file is availabl. The error message
indicates the command to use to create.
NOTE:
I had a problem at that step in the NVIDIA X Server
Settings tool wouldn't actually save the updated
xorg.conf.
but!
It would let me display it. So cut and pasted the
updated file and dropped it into an terminal editor
session.
5. Execute the nvidia xorg.conf creation command if required.
6. Remove the RgbPath from the newly created xorg.conf file.
If you don't do this X will issues a nice error message
in the log file: /var/log/Xorg.0.log telling you to.
6. Restart X
I think it was sufficient to restart X. I don't think I
had to reboot here.
7. Using the desktop tool to configure the display:
Select from the little GNOME "Foot":
System Tools/NVIDIA X Server Setting
Enable the twin view stuff.
8. Pay homage to the gods of X configuration
9. Restart X...
Posted at 02:02PM Mar 06, 2009 by Joseph Vlcek in Sun | Comments[1]