Fake The hostid Of A Solaris Zone, Updated
By Julien Gabel on Monday 6 October 2008, 15:00 - Solaris - Permalink
As a little follow-up to Fake The
hostid Of A Solaris Zone, and regarding the discussion on the capacity to change the hostid of a
Solaris non-global zone, it is interesting to mention these (updated)
informations:
- The
LD_PRELOADtrick proposed before is not a proper option, and is really ugly (and intrusive if you didn't unset it before continuing the execution of a program). - When using Solaris 8 or Solaris 9 Containers, there is a feature called
Host ID Emulation from the
zonecfgutility which can do exactly that. - Before the introduction of the privileges in a non-global zone with Solaris
11/06 (a.k.a. Solaris Update 3), you must run the DTrace
zhostidscript (daemon) within the global zone. It is not mandatory to run it from the global zone anymore. Using the appropriatedtrace_userprivilege only, you can run it directly from the non-global zone:# zonecfg -z ngzone set limitpriv=default,dtrace_user # zoneadm -z ngzone boot # zlogin ngzone [Connected to zone 'ngzone' pts/5] Last login: Sat Oct 4 18:57:17 on pts/5 Sun Microsystems Inc. SunOS 5.11 snv_99 November 2008 # /sbin/zonename ngzone # /usr/bin/hostid 837d47dd # ./zhostid & [1] 21506 # /usr/bin/hostid 20a82f32 # ^D [Connection to zone 'ngzone' pts/5 closed]

Oracle ACE
Comments
this solution isn't sufficient. If you run zhostid in non global zone, only super-user get the modified hostid, other users get the initial hostid