###################################################################################################################################################### starting with 2009.06 or with a dev release like osol-1002 based on snv124 1) disable nwam and reconfigure the network manually from remote: echo "vintage" > /etc/hostname.iprb0 echo "::1 localhost loghost" > /etc/hosts echo "127.0.0.1 localhost loghost" >> /etc/hosts echo "192.168.0.7 vintage vintage.sick-net" >> /etc/hosts echo "192.168.0.254" > /etc/defaultrouter echo "domain sick-net" > /etc/resolv.conf echo "nameserver 192.168.0.254" >> /etc/resolv.conf edit /etc/nsswitch.conf and be sure to not have: hosts: files ipnodes: files but to have: hosts: files dns ipnodes: files dns echo "192.168.0.0 255.255.255.0" >> /etc/inet/netmasks echo "svcadm disable svc:/network/physical:nwam" > /tmp/net.sh echo "sleep 5" >> /tmp/net.sh echo "svcadm enable svc:/network/physical:default" >> /tmp/net.sh chmod u+x /tmp/net.sh nohup /tmp/net.sh & now you should be able to reconnect from remote and this conf will persist after reboots (redo the /etc/nsswitch.conf step because nwam will remove dns after being disabled) 2) add the needed repositories and install the needed packages: pkg set-publisher -O http://pkg.opensolaris.org/contrib/ contrib this is not needed if you use a dev release: pkg set-publisher -O http://pkg.opensolaris.org/dev/ dev then go here and download the proper certificates https://pkg.sun.com/register/ mkdir -m 0755 -p /var/pkg/ssl cp -i /export/home/sickness/OpenSolaris_extras.key.pem /var/pkg/ssl cp -i /export/home/sickness/OpenSolaris_extras.certificate.pem /var/pkg/ssl pkg set-publisher -k /var/pkg/ssl/OpenSolaris_extras.key.pem -c /var/pkg/ssl/OpenSolaris_extras.certificate.pem -O https://pkg.sun.com/opensolaris/extra/ extra pkg list -a 'pkg://extra/*' this is not needed if you use a dev release: pkg set-publisher -P dev pkg install SUNWvirt-manager pkg install SUNWvirtinst pkg install SUNWxvm pkg install xvm pkg install xvm-gui echo 'set zfs:zfs_arc_max = 0x10000000' >>/etc/system 3) add the proper entry to boot xvm to the /rpool/boot/grub/menu.lst file: (comment all the splashimage, background and foreground entries, and change all the console=graphics statements to console=text) title xvm_124 findroot (pool_rpool,0,a) bootfs rpool/ROOT/opensolaris kernel$ /boot/$ISADIR/xen.gz module$ /platform/i86xpv/kernel/$ISADIR/unix /platform/i86xpv/kernel/$ISADIR/unix -B $ZFS-BOOTFS,console=text module$ /platform/i86pc/$ISADIR/boot_archive (now remember to change default 0 to default 1 to automatically boot this entry) 4) optionally disable the gui, set the xvm services to start by default, and then reboot: (svcadm disable gdm) svcadm enable -r xvm/virtd ; svcadm enable -r xvm/domains since IPS126: svcadm enable -r milestone/xvm svccfg -s svc:/system/boot-config:default setprop config/fastreboot_default=false shutdown -y -g0 -i6 5) create a zfs volume to use in this way: zfs create -V 4g rpool/openbsd #to optionally enable compression zfs set compression=on rpool/openbsd ( zfs create -V 8g maxtor80/opensolaris ) 6) create an etherstub and create a vnic on top of it (this is host-only, if you want a bridged configuration, create the vnic directly on top of the physical one): dladm create-etherstub etherstub0 ( dladm set-linkprop -p mtu=1500 etherstub0 ) dladm create-vnic -l etherstub0 vnic0 ifconfig vnic0 plumb ifconfig vnic0 up ifconfig vnic0 192.168.18.1 echo "192.168.18.1 vnic.sick-net vnic" >> /etc/hosts echo "vnic" > /etc/hostname.vnic0 7) enable ipv4 packet forwarding (needed for host-only networking): svcadm enable svc:/network/ipv4-forwarding:default 8) pratical exaples of guest creation and install and modification: #install an openbsd vm (if you don't want the vnc window to open automatically remove the --vnc option) virt-install -n openbsd --hvm -r 256 -f /dev/zvol/dsk/rpool/openbsd --vnc -c /export/home/sickness/iso/openbsd/openbsd45i386.iso --os-type=unix --os-variant=openbsd4 -w bridge=etherstub0 #to make openbsd use the proper emulated ethernet device (not needed since snv124): mkdir /etc/xen xm list -l openbsd > /etc/xen/openbsd.sxp virsh destroy openbsd virsh undefine openbsd vi /etc/xen/openbsd.sxp in the vif definition, just above (script vif-vnic) add: (model ne2k_pci) and change (boot d) to (boot c) save the file, exit and then: xm new -F /etc/xen/openbsd.sxp then login as root in the openbsd domU openbsd and do this: mv /etc/hostname.re0 /etc/hostname.ne3 reboot (if you want to remove the iso afterwards: "virsh detach-disk openbsd hdc" ) #to quickly try a live distro, for example like knoppix: touch /tmp/knoppix.img virt-install -n knoppix --hvm -r 512 -f /tmp/knoppix.img --vnc -c /export/home/sickness/iso/linux/KNOPPIX_V5.3.1DVD-2008-03-26-EN.iso --os-type=linux --os-variant=generic26 -w bridge=etherstub0 #to install winxp: virt-install -n winxp --hvm -r 1024 -f /dev/zvol/dsk/rpool/winxp --vnc -c /export/home/sickness/iso/winxp/xpsp3ita.iso --os-type=windows --os-variant=winxp -w bridge=etherstub0 (you may want to remove the iso afterwards: "virsh detach-disk winxp hdc" ) #to install opensolaris: virt-install -n opensolaris --hvm -r 1024 -f /dev/zvol/dsk/maxtor80/opensolaris --vnc -c /constructor/media/OpenSolaris.iso --os-type=solaris --os-variant=opensolaris -w bridge=etherstub0 9) to install sun's own microsoft certified win32 guest additions go here (tested with xen 3.1.4 gate): https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=Sun-xVM-guestadd-EA3-G-F@CDS-CDS_SMI to try the GPL PV drivers go here (beware: I've been told to NOT use them in solaris's XEN!): http://www.meadowcourt.org/downloads/ (http://wiki.xensource.com/xenwiki/XenWindowsGplPv) 10) firewall your HOST with ipf: vi /etc/ipf/ipf.conf and add: pass in quick on iprb0 proto tcp from any to 192.168.0.7/32 port = 22 keep state pass in quick on iprb0 proto tcp from any to 192.168.18.2/32 port = 22 keep state pass in quick on iprb0 from 192.168.18.2/32 to any pass out quick on iprb0 proto tcp from any to any keep state pass out quick on iprb0 proto udp from any to any keep state pass out quick on iprb0 proto icmp from any to any keep state block in quick on iprb0 all block out quick on iprb0 all then: svcadm enable network/ipfilter ipf -Fa -f /etc/ipf/ipf.conf ipfstat -ioh (every time you add or remove rules issue a "ipf -Fa -f /etc/ipf/ipf.conf") 11) to later update your opensolaris release: pkg refresh --full pkg install SUNWipkg pkg image-update --be-name opensolaris-124 (do this as root and then remember to manually update the xvm entries in the grub menu.lst file!) 11) study also: http://mail.opensolaris.org/pipermail/xen-discuss/2009-March/004681.html http://mail.opensolaris.org/pipermail/xen-discuss/2009-January/004469.html http://mail.opensolaris.org/pipermail/xen-discuss/2009-January/004483.html http://estseg.blogspot.com/2009/04/jak-dodac-vnic-do-domeny-w-xvm.html ######################################################################################################################################################