Sachin Goel
2009-Dec-21 16:53 UTC
[Xen-devel] How to detect if a machine is a Virtual machine ??
Hi, Just curious to know, if there is any way that given a terminal to a box, we can determine is it a physical machine or a virtual machine ? Thanks, Sachin. _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Konrad Rzeszutek Wilk
2009-Dec-21 16:56 UTC
Re: [Xen-devel] How to detect if a machine is a Virtual machine ??
> Just curious to know, if there is any way that given a terminal to a > box, we can determine is it a physical machine or a virtual machine ?./tools/misc/xen-detect.c _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Sachin Goel
2009-Dec-21 18:00 UTC
Re: [Xen-devel] How to detect if a machine is a Virtual machine ??
Hi, Where is the tools directory located ? I am not able to find it on a xen virtual machine..:( Thanks, Sachin. ----- Original Message ----- From: konrad.wilk@oracle.com To: sachin.goel@oracle.com Cc: xen-devel@lists.xensource.com Sent: Monday, December 21, 2009 10:34:20 PM GMT +05:30 Chennai, Kolkata, Mumbai, New Delhi Subject: Re: [Xen-devel] How to detect if a machine is a Virtual machine ??> Just curious to know, if there is any way that given a terminal to a > box, we can determine is it a physical machine or a virtual machine ?./tools/misc/xen-detect.c _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Michal Novotny
2009-Dec-22 10:37 UTC
Re: [Xen-devel] How to detect if a machine is a Virtual machine ??
Hi Sachin, the tool is not in the virtual machine. This is the tool that''s in dom0. Since there is a source code for this one you could scp it to the guest, compile and run inside the guest environment. There is no need to provide a guest with this tool by default and in fact this is really impossible so it''s better to scp it to the guest and compile there. Michal On 12/21/2009 07:00 PM, Sachin Goel wrote:> Hi, > > Where is the tools directory located ? > > I am not able to find it on a xen virtual machine..:( > > Thanks, > Sachin. > > ----- Original Message ----- > From: konrad.wilk@oracle.com > To: sachin.goel@oracle.com > Cc: xen-devel@lists.xensource.com > Sent: Monday, December 21, 2009 10:34:20 PM GMT +05:30 Chennai, Kolkata, Mumbai, New Delhi > Subject: Re: [Xen-devel] How to detect if a machine is a Virtual machine ?? > > >> Just curious to know, if there is any way that given a terminal to a >> box, we can determine is it a physical machine or a virtual machine ? >> > ./tools/misc/xen-detect.c > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
John Haxby
2009-Dec-23 09:16 UTC
Re: [Xen-devel] How to detect if a machine is a Virtual machine ??
On 22/12/09 10:37, Michal Novotny wrote:> Hi Sachin, > the tool is not in the virtual machine. This is the tool that''s in > dom0. Since there is a source code for this one you could scp it to > the guest, compile and run inside the guest environment. There is no > need to provide a guest with this tool by default and in fact this is > really impossible so it''s better to scp it to the guest and compile > there.It''s also worth pointing out that the underlying test for xen in this program executes a particular instruction to find the information about its environment. What that means is that it''s possible to write a version of ./tools/misc/xen-detect.c that will work in any guest machine OS. jch _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Michal Novotny
2009-Dec-23 09:30 UTC
Re: [Xen-devel] How to detect if a machine is a Virtual machine ??
On 12/23/2009 10:16 AM, John Haxby wrote:> On 22/12/09 10:37, Michal Novotny wrote: >> Hi Sachin, >> the tool is not in the virtual machine. This is the tool that''s in >> dom0. Since there is a source code for this one you could scp it to >> the guest, compile and run inside the guest environment. There is no >> need to provide a guest with this tool by default and in fact this is >> really impossible so it''s better to scp it to the guest and compile >> there. > > It''s also worth pointing out that the underlying test for xen in this > program executes a particular instruction to find the information > about its environment. What that means is that it''s possible to > write a version of ./tools/misc/xen-detect.c that will work in any > guest machine OS. >I am not saying this does not work in any guest machine but just that the tools is provided in dom0 only and installed to guest machines by default. In fact it''s trapping some instruction and according to my testing it''s OK to scp it to the guest and XEN_PV return value will be set for PV guest or XEN_FV (or something similar) for fully virtualized environment... Michal _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Michal Novotny
2009-Dec-23 09:34 UTC
Re: [Xen-devel] How to detect if a machine is a Virtual machine ??
On 12/23/2009 10:16 AM, John Haxby wrote:> On 22/12/09 10:37, Michal Novotny wrote: >> Hi Sachin, >> the tool is not in the virtual machine. This is the tool that''s in >> dom0. Since there is a source code for this one you could scp it to >> the guest, compile and run inside the guest environment. There is no >> need to provide a guest with this tool by default and in fact this is >> really impossible so it''s better to scp it to the guest and compile >> there. > > It''s also worth pointing out that the underlying test for xen in this > program executes a particular instruction to find the information > about its environment. What that means is that it''s possible to > write a version of ./tools/misc/xen-detect.c that will work in any > guest machine OS.But one more point, if you want to know whether XEN_PV is returned for dom0 PV guest or domU (since it''s the same for both) you can try to look for /proc/xen/privcmd. This one is available only in dom0 because privileged commands are for privileged domain (domain-0) only... Michal _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Michal Novotny
2009-Dec-23 09:35 UTC
Re: [Xen-devel] How to detect if a machine is a Virtual machine ??
On 12/23/2009 10:34 AM, Michal Novotny wrote:> On 12/23/2009 10:16 AM, John Haxby wrote: >> On 22/12/09 10:37, Michal Novotny wrote: >>> Hi Sachin, >>> the tool is not in the virtual machine. This is the tool that''s in >>> dom0. Since there is a source code for this one you could scp it to >>> the guest, compile and run inside the guest environment. There is no >>> need to provide a guest with this tool by default and in fact this >>> is really impossible so it''s better to scp it to the guest and >>> compile there. >> >> It''s also worth pointing out that the underlying test for xen in this >> program executes a particular instruction to find the information >> about its environment. What that means is that it''s possible to >> write a version of ./tools/misc/xen-detect.c that will work in any >> guest machine OS. > But one more point, if you want to know whether XEN_PV is returned for > dom0 PV guest or domU (since it''s the same for both) you can try to > look for /proc/xen/privcmd. This one is available only in dom0 because > privileged commands are for privileged domain (domain-0) only...Oh, sorry, I did mean for domU PV guest or dom0, of course... Michal _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Sachin Goel
2009-Dec-23 20:39 UTC
Re: [Xen-devel] How to detect if a machine is a Virtual machine ??
Thanks Michal for clarifying.. For a moment I got confused :) - Sachin. ----- Original Message ----- From: minovotn@redhat.com To: xen-devel@lists.xensource.com Sent: Thursday, December 24, 2009 1:20:34 AM GMT +05:30 Chennai, Kolkata, Mumbai, New Delhi Subject: Re: [Xen-devel] How to detect if a machine is a Virtual machine ?? On 12/23/2009 10:34 AM, Michal Novotny wrote:> On 12/23/2009 10:16 AM, John Haxby wrote: >> On 22/12/09 10:37, Michal Novotny wrote: >>> Hi Sachin, >>> the tool is not in the virtual machine. This is the tool that''s in >>> dom0. Since there is a source code for this one you could scp it to >>> the guest, compile and run inside the guest environment. There is no >>> need to provide a guest with this tool by default and in fact this >>> is really impossible so it''s better to scp it to the guest and >>> compile there. >> >> It''s also worth pointing out that the underlying test for xen in this >> program executes a particular instruction to find the information >> about its environment. What that means is that it''s possible to >> write a version of ./tools/misc/xen-detect.c that will work in any >> guest machine OS. > But one more point, if you want to know whether XEN_PV is returned for > dom0 PV guest or domU (since it''s the same for both) you can try to > look for /proc/xen/privcmd. This one is available only in dom0 because > privileged commands are for privileged domain (domain-0) only...Oh, sorry, I did mean for domU PV guest or dom0, of course... Michal _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel
Michal Novotny
2010-Jan-04 06:32 UTC
Re: [Xen-devel] How to detect if a machine is a Virtual machine ??
Yeah, sorry about that. Hope you''re not confused anymore ;) Michal On 12/23/2009 09:39 PM, Sachin Goel wrote:> Thanks Michal for clarifying.. > > For a moment I got confused :) > > - Sachin. > > ----- Original Message ----- > From: minovotn@redhat.com > To: xen-devel@lists.xensource.com > Sent: Thursday, December 24, 2009 1:20:34 AM GMT +05:30 Chennai, Kolkata, Mumbai, New Delhi > Subject: Re: [Xen-devel] How to detect if a machine is a Virtual machine ?? > > On 12/23/2009 10:34 AM, Michal Novotny wrote: > >> On 12/23/2009 10:16 AM, John Haxby wrote: >> >>> On 22/12/09 10:37, Michal Novotny wrote: >>> >>>> Hi Sachin, >>>> the tool is not in the virtual machine. This is the tool that''s in >>>> dom0. Since there is a source code for this one you could scp it to >>>> the guest, compile and run inside the guest environment. There is no >>>> need to provide a guest with this tool by default and in fact this >>>> is really impossible so it''s better to scp it to the guest and >>>> compile there. >>>> >>> It''s also worth pointing out that the underlying test for xen in this >>> program executes a particular instruction to find the information >>> about its environment. What that means is that it''s possible to >>> write a version of ./tools/misc/xen-detect.c that will work in any >>> guest machine OS. >>> >> But one more point, if you want to know whether XEN_PV is returned for >> dom0 PV guest or domU (since it''s the same for both) you can try to >> look for /proc/xen/privcmd. This one is available only in dom0 because >> privileged commands are for privileged domain (domain-0) only... >> > Oh, sorry, I did mean for domU PV guest or dom0, of course... > > Michal > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel >_______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel