Detecting xen

John Summerfield debian at herakles.homelinux.org
Thu Jun 5 01:23:49 UTC 2008


Joel Andres Granados wrote:
> Gerrard Geldenhuis wrote:
>> Hi
>>
>> I have the following in a pre-script to detect whether I am building a
>> xen machine:
>>
>> set $(list-harddrives)
>>
>> vx=$(echo $2|cut -d. -f 1 )
>>
>> if [ $vx -lt 5120 ]; then
>>
>>         echo 'xen' > /tmp/xen
>>
>>  
>>
>> etc...
> 
> just check for the /proc/xen/capabilities file.


I thought of that, then dismissed it as xen support isn't needed for 
fully-virtualised guests.

It used to be that one could look at /proc/pci, but that got removed. At 
present xen (and kvm) emulate fairly antiquated PCI hardware.

dmesg | grep -q <something> && echo It's virtual
<something> == QEMU detects KVM here (f9 host, debian guest.
<something> == PIIX3 also occurs in KVM, maybe also in Xen (I don't have 
a working xen at present).

A regex looking for ACPI and other stuff should work too.





-- 

Cheers
John

-- spambait
1aaaaaaa at coco.merseine.nu  Z1aaaaaaa at coco.merseine.nu
-- Advice
http://webfoot.com/advice/email.top.php
http://www.catb.org/~esr/faqs/smart-questions.html
http://support.microsoft.com/kb/555375

You cannot reply off-list:-)




More information about the Kickstart-list mailing list