nsswitch.conf SMF config

# svccfg
svc:> select dns/client
svc:/network/dns/client> setprop config/search = astring: \
(“us.company.com” “eu.company.com” “companya.com” “companyb.com” “company.com” )
svc:/network/dns/client> setprop config/nameserver = net_address: \
( 138.2.202.15 138.2.202.25 )
svc:/network/dns/client> select dns/client:default
svc:/network/dns/client:default> refresh
svc:/network/dns/client:default> validate
svc:/network/dns/client:default> select name-service/switch
svc:/system/name-service/switch> setprop config/host = astring: “files dns”
svc:/system/name-service/switch> select system/name-service/switch:default
svc:/system/name-service/switch:default> refresh
svc:/system/name-service/switch:default> validate
svc:/system/name-service/switch:default>
# svcadm enable dns/client
# svcadm refresh name-service/switch
# grep host /etc/nsswitch.conf
hosts: files dns
# cat /etc/resolv.conf
#
# opyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
#

#
# _AUTOGENERATED_FROM_SMF_V1_
#
# WARNING: THIS FILE GENERATED FROM SMF DATA.
# DO NOT EDIT THIS FILE. EDITS WILL BE LOST.
# See resolv.conf(4) for details.

search us.company.com eu.company.com companya.com companyb.com company.com
nameserver 138.2.202.15
nameserver 138.2.202.25

OpenSolaris – SMF and VirtualBox

So… i’m looking for a way to fire up some VirtualBox machines after a reboot on OpenSolaris. SMF is the key. Just need to create some XML docs that fire up a couple of headless vm’s.

Shouldn’t be too hard. Lets see what i can come up with.

Here is a good pdf about migrating Legacy RC services into SMF, which has given me a few pointers….

how to shutdown a vm;

VBoxManage controlvm Test poweroff

how to startup a vm;

VBoxHeadless -s Test -p 3389

Update: so i’ve decided to bypass SMF at this point, which seems to be a really good method of executing (and maintaining) services, but a bit more than what i was after to run Virtualbox on start-up. If you see my other post i have just modified the /etc/profile to auto start the virtual machines and i’ve set the box to autologon on boot.

The problems i had while executing VirtualBox as a service were due to the fact it seemed to require access to the main X11 console (yes – i was using VBoxHeadless). There were a few issues that were thrown up if i didn’t execute from a session. Never looked into this any further…