From: hume.spamfilter on
mannu <manishsinghhyb(a)gmail.com> wrote:
> 1. In my solaris 8 non global zone (virtual machine), zonename command
> is not present.

Because Solaris 8 existed before virtualization became fashionable. You
might be able to write a command to emulate zonename's functionality, but
I don't know how you'd go about it.

> 2. I need to know in general (not just confined to solaris zones),
> regardless of any

Why? What does this gain you?

You're in for a very rough ride. I don't believe the redhat command you
gave would even work for all the scenarios you're trying to work with.

--
Brandon Hume - hume -> BOFH.Ca, http://WWW.BOFH.Ca/
From: webjuan on
On Apr 22, 9:38 am, mannu <manishsingh...(a)gmail.com> wrote:
> On Apr 22, 5:44 pm, webjuan <webj...(a)gmail.com> wrote:
>
>
>
> > On Apr 22, 8:21 am, mannu <manishsingh...(a)gmail.com> wrote:
>
> > > Hello,
>
> > > Is there a way to know if solaris operating system is running as a
> > > guest virtual machine on
> > > a physical host ?
>
> > > There is a utility "virt-what" from redhat that does the above job for
> > > linux. Is there any
> > > similar utility for solaris ?
>
> > > Thanks and Regards,
> > > Manish Singh.
>
> > There are several ways but the easiest is to log into the virtual (aka
> > Solaris Zone) and run:
>
> > # /usr/bin/zonename
>
> > If you get "global" then you are obviously on a global zone (physical
> > machine).  If you get a hostname back, then you are on a virtual.
> > Keep in mind that the virtual (non-global) was purposely designed to
> > not know anything about the global.
>
> > juan martinez
>
> Hello juan,
>
> Thankyou for the reply.
>
> There are certain things that are not clear still:
>
> 1. In my solaris 8 non global zone (virtual machine), zonename command
> is not present.
>    zonename command is present in the global zone (physical machine).
> Hence there will
>    be difficulty to run zonename from virtual machine.
>
> 2. I need to know in general (not just confined to solaris zones),
> regardless of any
>     virtualization software like vmware, xen, virtual pc, qemu,
> solaris zones etc,...
>     whether operating system is running as a virtual machine on top of
> a physical host.
>
> Thanks and Regards,
> Manish Singh.

I dont have much experience with branded zones but here is my attempt
at #2.

1. You can no longer use SVM commands

non-global-zone# metastat -p
metastat: zonename: Volume administration unavailable within non-
global zones

2. If only using lofs devices, the format command returns nothing

non-global-zone# format
Searching for disks…done
No disks found!

3. lsof no longer works, see lsof FAQ at
http://www.mirrorservice.org/sites/vic.cc.purdue.edu/pub/tools/unix/lsof/FAQ

non-global-zone# lsof
lsof: can’t stat(/devices): No such file or directory

4. A Solaris zone has a "zsched" process as apposed to a “sched”

non-global-zone# ps -ef | grep sched

5. A Solaris zone will not show any global processes when running a ps
with a “-Z” option

non-global-zone# ps -ef -Z | grep global
non-global-zone root 25463 29042 0 03:53:04 pts/60 0:00 grep
global

6. mknod no longer works because it cant write to /dev/

non-global-zone# mknod /dev/testing c 4 64
mknod: Not owner

7. zonecfg can only be run from the global zone

non-global-zone# zonecfg -z test
zonecfg can only be run from the global zone.

8. zoneadm will only print you the non-global zone

non-global-zone# zoneadm list
non-global-zone

9. zlogin can only be run from the global zone

non-global-zone# zlogin other-non-global-zone
zlogin: ‘zlogin’ may only be used from the global zone

10. prstat does not show you “global” zone usage, just hostname when
using “-Z” option

non-global-zone# prstat -Z

11. Missing /etc/ethers

non-global-zone# ls -la /etc/ethers
/etc/ethers: No such file or directory

12. dispadmin does not work

non-global-zone# dispadmin -d
dispadmin: Operation not supported in non-global zones

13. prtdiag does not work

non-global-zone# prtdiag
prtdiag can only be run in the global zone

14. dumpadm no longer works

non-global-zone# dumpadm
dumpadm: failed to open /dev/dump: No such file or directory

Keep in mind that this is not a complete list. Its just things that
I've personally come across. Let us know what works for you, if
anything.

juan martinez
From: Doug McIntyre on
hume.spamfilter(a)bofh.ca writes:
>You're in for a very rough ride. I don't believe the redhat command you
>gave would even work for all the scenarios you're trying to work with.

It'd probably work on x86 PC's pretty easily by just scanning the ACPI
strings presented to the OS. Each of the VM solutions tend to put
their own brand of ACPI strings in to identify it back to the OS
drivers for specific things.

But beyond that, would fail pretty hard on most of the other virtual
technologies that others have been discussing in this thread (let
alone domains and other setups on the really big iron).
From: Jeff Makey on
The most portable and reliable way I have found to determine whether
or not a process is in the global zone is to look for process 1 (with
ps or in /proc). If you can see PID 1 then you are in the global
zone; if not you are in a non-global zone.

:: Jeff Makey
jeff(a)sdsc.edu

Department of Tautological Pleonasms and Superfluous Redundancies Department
From: Zfs.. on
On Apr 22, 1:21 pm, mannu <manishsingh...(a)gmail.com> wrote:
> Hello,
>
> Is there a way to know if solaris operating system is running as a
> guest virtual machine on
> a physical host ?
>
> There is a utility "virt-what" from redhat that does the above job for
> linux. Is there any
> similar utility for solaris ?
>
> Thanks and Regards,
> Manish Singh.

Run prtdiag.

If you are in a non-global zone it will tell you that this command can
only be run in the global zone.

e.g.

root(a)non-global# prtdiag
prtdiag can only be run in the global zone
 | 
Pages: 1
Prev: Safe to bypass fsck?
Next: Safe to bypass fsck?