public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* DMI BIOS String
@ 2011-08-22  3:52 Derek
  2011-08-22  9:45 ` Daniel P. Berrange
  2011-08-22 11:55 ` Andrew Cathrow
  0 siblings, 2 replies; 7+ messages in thread
From: Derek @ 2011-08-22  3:52 UTC (permalink / raw)
  To: kvm

Hi Folks,

I could not track down any solid info on modifying the DMI BIOS string.

For example, in VirtualBox you can use 'vboxmanage setsextradata' to set the BIOS product and vendor string per VM.

Any ideas if this is possible with KVM?

Thanks,
Derek

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DMI BIOS String
  2011-08-22  3:52 DMI BIOS String Derek
@ 2011-08-22  9:45 ` Daniel P. Berrange
  2011-08-22 11:55 ` Andrew Cathrow
  1 sibling, 0 replies; 7+ messages in thread
From: Daniel P. Berrange @ 2011-08-22  9:45 UTC (permalink / raw)
  To: Derek; +Cc: kvm

On Mon, Aug 22, 2011 at 03:52:19PM +1200, Derek wrote:
> Hi Folks,
> 
> I could not track down any solid info on modifying the DMI BIOS string.
> 
> For example, in VirtualBox you can use 'vboxmanage setsextradata' to
> set the BIOS product and vendor string per VM.
> 
> Any ideas if this is possible with KVM?

If using QEMU directly you can use '-smbios' args. eg

    -smbios "type=0,vendor=LENOVO,version=6FET82WW (3.12 )"
    -smbios "type=1,manufacturer=Fedora,product=Virt-Manager,version=0.8.2-3.fc14,serial=32dfcb37-5af1-552b-357c-be8c3aa38310,uuid=c7a5fdbd-edaf-9455-926a-d65c16db1809,sku=1234567890,family=Red Hat"

If using QEMU via libvirt you can use the following:

  http://libvirt.org/formatdomain.html#elementsSysinfo


Daniel
-- 
|: http://berrange.com      -o-    http://www.flickr.com/photos/dberrange/ :|
|: http://libvirt.org              -o-             http://virt-manager.org :|
|: http://autobuild.org       -o-         http://search.cpan.org/~danberr/ :|
|: http://entangle-photo.org       -o-       http://live.gnome.org/gtk-vnc :|

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DMI BIOS String
  2011-08-22  3:52 DMI BIOS String Derek
  2011-08-22  9:45 ` Daniel P. Berrange
@ 2011-08-22 11:55 ` Andrew Cathrow
  2011-08-22 20:03   ` Ryan Harper
  1 sibling, 1 reply; 7+ messages in thread
From: Andrew Cathrow @ 2011-08-22 11:55 UTC (permalink / raw)
  To: Derek; +Cc: kvm



----- Original Message -----
> From: "Derek" <lists@stuntkiwi.com>
> To: kvm@vger.kernel.org
> Sent: Sunday, August 21, 2011 11:52:19 PM
> Subject: DMI BIOS String
> Hi Folks,
> 
> I could not track down any solid info on modifying the DMI BIOS
> string.

qemu-kvm -help | grep bios

-smbios file=binary
-smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
-smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]

or if you're using libvirt
http://libvirt.org/formatdomain.html#elementsSysinfo


> 
> For example, in VirtualBox you can use 'vboxmanage setsextradata' to
> set the BIOS product and vendor string per VM.
> 
> Any ideas if this is possible with KVM?
> 
> Thanks,
> Derek--
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DMI BIOS String
  2011-08-22 11:55 ` Andrew Cathrow
@ 2011-08-22 20:03   ` Ryan Harper
  2011-08-22 23:55     ` Derek
  0 siblings, 1 reply; 7+ messages in thread
From: Ryan Harper @ 2011-08-22 20:03 UTC (permalink / raw)
  To: Derek; +Cc: Andrew Cathrow, kvm

* Andrew Cathrow <acathrow@redhat.com> [2011-08-22 06:55]:
> 
> 
> ----- Original Message -----
> > From: "Derek" <lists@stuntkiwi.com>
> > To: kvm@vger.kernel.org
> > Sent: Sunday, August 21, 2011 11:52:19 PM
> > Subject: DMI BIOS String
> > Hi Folks,
> > 
> > I could not track down any solid info on modifying the DMI BIOS
> > string.
> 
> qemu-kvm -help | grep bios
> 
> -smbios file=binary

for binary mode, this commit message is most helpful


 commit b6f6e3d3a71cee61320216a42940cfaa9b42a162
 Author: aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
 Date:   Fri Apr 17 18:59:56 2009 +0000

    qemu: Add support for SMBIOS command line otions (Alex Williamson)
    
    Create a new -smbios option (x86-only) to allow binary SMBIOS entries
    to be passed through to the BIOS or modify the default values of
    individual fields of type 0 and 1 entries on the command line.
    
    Binary SMBIOS entries can be generated as follows:
    
    dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
            perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
    
    These can then be passed to the BIOS using this switch:
    
     -smbios file=smbios_type_1.bin
    
    Command line generation supports the following syntax:
    
     -smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
     -smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
                  [,uuid=$(uuidgen)][,sku=str][,family=str]
    
    For instance, to add a serial number to the type 1 table:
    
     -smbios type=1,serial=0123456789
    
    Interface is extensible to support more fields/tables as needed.
    
    aliguori: remove texi formatting from help output
    
    Signed-off-by: Alex Williamson <alex.williamson@hp.com>
    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>


> -smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
> -smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
> 
> or if you're using libvirt
> http://libvirt.org/formatdomain.html#elementsSysinfo
> 
> 
> > 
> > For example, in VirtualBox you can use 'vboxmanage setsextradata' to
> > set the BIOS product and vendor string per VM.
> > 
> > Any ideas if this is possible with KVM?
> > 
> > Thanks,
> > Derek--
> > To unsubscribe from this list: send the line "unsubscribe kvm" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at http://vger.kernel.org/majordomo-info.html
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
ryanh@us.ibm.com

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DMI BIOS String
  2011-08-22 20:03   ` Ryan Harper
@ 2011-08-22 23:55     ` Derek
  2011-08-23  4:30       ` Derek
  0 siblings, 1 reply; 7+ messages in thread
From: Derek @ 2011-08-22 23:55 UTC (permalink / raw)
  To: kvm

Thanks everyone for the useful replies.

I am using libvirt, one thing i'm observing after adding the following sysinfo to the VM.xml file is that in the qemu log file for the VM it is not being passed to the command when booting.

  <os>
    <type arch='x86_64' machine='pc-0.12'>hvm</type>
    <boot dev='cdrom'/>
    <smbios mode='sysinfo'/>
  </os>
  <sysinfo type='smbios'>
    <bios>
      <entry name='vendor'>xxx xxx</entry>
    </bios>
    <system>
      <entry name='product'>xxx</entry>
      <entry name='manufacturer'>xxx xxx</entry>
      <entry name='vendor'>xxx</entry>
      <entry name='model'>xxx</entry>
    </system>
  </sysinfo>

Is there a step i'm missing to have the xml file re-read after changes?

Editing the xml file on the command line, and using libvirt to boot.

FYI here is the command shown in the logs while booting..

LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/root USER=root LOGNAME=root QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 1024 -smp 2,sockets=2,cores=1,threads=1 -name Test -uuid a8024009-d459-ad03-0fca-304746a93c8a -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/HMC.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=utc -boot d -drive file=/install-images/install.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -device rtl8139,vlan=0,id=net0,mac=52:54:00:4e:80:a4,bus=pci.0,addr=0x3 -net tap,fd=49,vlan=0,name=hostnet0 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -vnc 127.0.0.1:4 -vga cirrus -device virtio-b
 alloon-pci,id=balloon0,bus=pci.0,addr=0x4 
char device redirected to /dev/pts/4

I tried running the above manually with -smbios type=1 etc added but I am receiving bad file descriptor errors, perhaps my own error or inexperience with KVM.

Thanks!
Derek

On 23/08/2011, at 8:03 AM, Ryan Harper wrote:

> * Andrew Cathrow <acathrow@redhat.com> [2011-08-22 06:55]:
>> 
>> 
>> ----- Original Message -----
>>> From: "Derek" <lists@stuntkiwi.com>
>>> To: kvm@vger.kernel.org
>>> Sent: Sunday, August 21, 2011 11:52:19 PM
>>> Subject: DMI BIOS String
>>> Hi Folks,
>>> 
>>> I could not track down any solid info on modifying the DMI BIOS
>>> string.
>> 
>> qemu-kvm -help | grep bios
>> 
>> -smbios file=binary
> 
> for binary mode, this commit message is most helpful
> 
> 
> commit b6f6e3d3a71cee61320216a42940cfaa9b42a162
> Author: aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
> Date:   Fri Apr 17 18:59:56 2009 +0000
> 
>    qemu: Add support for SMBIOS command line otions (Alex Williamson)
> 
>    Create a new -smbios option (x86-only) to allow binary SMBIOS entries
>    to be passed through to the BIOS or modify the default values of
>    individual fields of type 0 and 1 entries on the command line.
> 
>    Binary SMBIOS entries can be generated as follows:
> 
>    dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
>            perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
> 
>    These can then be passed to the BIOS using this switch:
> 
>     -smbios file=smbios_type_1.bin
> 
>    Command line generation supports the following syntax:
> 
>     -smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
>     -smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
>                  [,uuid=$(uuidgen)][,sku=str][,family=str]
> 
>    For instance, to add a serial number to the type 1 table:
> 
>     -smbios type=1,serial=0123456789
> 
>    Interface is extensible to support more fields/tables as needed.
> 
>    aliguori: remove texi formatting from help output
> 
>    Signed-off-by: Alex Williamson <alex.williamson@hp.com>
>    Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
> 
> 
>> -smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
>> -smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
>> 
>> or if you're using libvirt
>> http://libvirt.org/formatdomain.html#elementsSysinfo
>> 
>> 
>>> 
>>> For example, in VirtualBox you can use 'vboxmanage setsextradata' to
>>> set the BIOS product and vendor string per VM.
>>> 
>>> Any ideas if this is possible with KVM?
>>> 
>>> Thanks,
>>> Derek--
>>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> -- 
> Ryan Harper
> Software Engineer; Linux Technology Center
> IBM Corp., Austin, Tx
> ryanh@us.ibm.com
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DMI BIOS String
  2011-08-22 23:55     ` Derek
@ 2011-08-23  4:30       ` Derek
  2011-08-23  6:45         ` Philipp Hahn
  0 siblings, 1 reply; 7+ messages in thread
From: Derek @ 2011-08-23  4:30 UTC (permalink / raw)
  To: kvm

I found 'virsh edit' is the recommended way to make changes to a VM configuration, the XML file is not referenced at boot, it is only saved to with 'virsh dumpxml'.  'virsh edit' will update both areas - hypervisor and XML file.

Unfortunately the changes I make for smbios and sysinfo (as below) while editing don't appear to be accepted when saving with 'virsh edit'.  I wonder if they are perhaps not supported with virsh edit yet?

Does anyone have experience with this, or an idea on why I would receive 'bad file descriptor' errors using the kvm command manually.

Thanks in advance,
Derek

On 23/08/2011, at 11:55 AM, Derek wrote:

> Thanks everyone for the useful replies.
> 
> I am using libvirt, one thing i'm observing after adding the following sysinfo to the VM.xml file is that in the qemu log file for the VM it is not being passed to the command when booting.
> 
>  <os>
>    <type arch='x86_64' machine='pc-0.12'>hvm</type>
>    <boot dev='cdrom'/>
>    <smbios mode='sysinfo'/>
>  </os>
>  <sysinfo type='smbios'>
>    <bios>
>      <entry name='vendor'>xxx xxx</entry>
>    </bios>
>    <system>
>      <entry name='product'>xxx</entry>
>      <entry name='manufacturer'>xxx xxx</entry>
>      <entry name='vendor'>xxx</entry>
>      <entry name='model'>xxx</entry>
>    </system>
>  </sysinfo>
> 
> Is there a step i'm missing to have the xml file re-read after changes?
> 
> Editing the xml file on the command line, and using libvirt to boot.
> 
> FYI here is the command shown in the logs while booting..
> 
> LC_ALL=C PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/root USER=root LOGNAME=root QEMU_AUDIO_DRV=none /usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 1024 -smp 2,sockets=2,cores=1,threads=1 -name Test -uuid a8024009-d459-ad03-0fca-304746a93c8a -nodefaults -chardev socket,id=monitor,path=/var/lib/libvirt/qemu/HMC.monitor,server,nowait -mon chardev=monitor,mode=readline -rtc base=utc -boot d -drive file=/install-images/install.iso,if=none,media=cdrom,id=drive-ide0-1-0,readonly=on,format=raw -device ide-drive,bus=ide.1,unit=0,drive=drive-ide0-1-0,id=ide0-1-0 -device rtl8139,vlan=0,id=net0,mac=52:54:00:4e:80:a4,bus=pci.0,addr=0x3 -net tap,fd=49,vlan=0,name=hostnet0 -chardev pty,id=serial0 -device isa-serial,chardev=serial0 -usb -vnc 127.0.0.1:4 -vga cirrus -device virtio
 -balloon-pci,id=balloon0,bus=pci.0,addr=0x4 
> char device redirected to /dev/pts/4
> 
> I tried running the above manually with -smbios type=1 etc added but I am receiving bad file descriptor errors, perhaps my own error or inexperience with KVM.
> 
> Thanks!
> Derek
> 
> On 23/08/2011, at 8:03 AM, Ryan Harper wrote:
> 
>> * Andrew Cathrow <acathrow@redhat.com> [2011-08-22 06:55]:
>>> 
>>> 
>>> ----- Original Message -----
>>>> From: "Derek" <lists@stuntkiwi.com>
>>>> To: kvm@vger.kernel.org
>>>> Sent: Sunday, August 21, 2011 11:52:19 PM
>>>> Subject: DMI BIOS String
>>>> Hi Folks,
>>>> 
>>>> I could not track down any solid info on modifying the DMI BIOS
>>>> string.
>>> 
>>> qemu-kvm -help | grep bios
>>> 
>>> -smbios file=binary
>> 
>> for binary mode, this commit message is most helpful
>> 
>> 
>> commit b6f6e3d3a71cee61320216a42940cfaa9b42a162
>> Author: aliguori <aliguori@c046a42c-6fe2-441c-8c8c-71466251a162>
>> Date:   Fri Apr 17 18:59:56 2009 +0000
>> 
>>   qemu: Add support for SMBIOS command line otions (Alex Williamson)
>> 
>>   Create a new -smbios option (x86-only) to allow binary SMBIOS entries
>>   to be passed through to the BIOS or modify the default values of
>>   individual fields of type 0 and 1 entries on the command line.
>> 
>>   Binary SMBIOS entries can be generated as follows:
>> 
>>   dmidecode -t 1 -u | grep $'^\t\t[^"]' | xargs -n1 | \
>>           perl -lne 'printf "%c", hex($_)' > smbios_type_1.bin
>> 
>>   These can then be passed to the BIOS using this switch:
>> 
>>    -smbios file=smbios_type_1.bin
>> 
>>   Command line generation supports the following syntax:
>> 
>>    -smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
>>    -smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
>>                 [,uuid=$(uuidgen)][,sku=str][,family=str]
>> 
>>   For instance, to add a serial number to the type 1 table:
>> 
>>    -smbios type=1,serial=0123456789
>> 
>>   Interface is extensible to support more fields/tables as needed.
>> 
>>   aliguori: remove texi formatting from help output
>> 
>>   Signed-off-by: Alex Williamson <alex.williamson@hp.com>
>>   Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
>> 
>> 
>>> -smbios type=0[,vendor=str][,version=str][,date=str][,release=%d.%d]
>>> -smbios type=1[,manufacturer=str][,product=str][,version=str][,serial=str]
>>> 
>>> or if you're using libvirt
>>> http://libvirt.org/formatdomain.html#elementsSysinfo
>>> 
>>> 
>>>> 
>>>> For example, in VirtualBox you can use 'vboxmanage setsextradata' to
>>>> set the BIOS product and vendor string per VM.
>>>> 
>>>> Any ideas if this is possible with KVM?
>>>> 
>>>> Thanks,
>>>> Derek--
>>>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>>>> the body of a message to majordomo@vger.kernel.org
>>>> More majordomo info at http://vger.kernel.org/majordomo-info.html
>>> --
>>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>> 
>> -- 
>> Ryan Harper
>> Software Engineer; Linux Technology Center
>> IBM Corp., Austin, Tx
>> ryanh@us.ibm.com
>> --
>> To unsubscribe from this list: send the line "unsubscribe kvm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> --
> To unsubscribe from this list: send the line "unsubscribe kvm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: DMI BIOS String
  2011-08-23  4:30       ` Derek
@ 2011-08-23  6:45         ` Philipp Hahn
  0 siblings, 0 replies; 7+ messages in thread
From: Philipp Hahn @ 2011-08-23  6:45 UTC (permalink / raw)
  To: Derek; +Cc: kvm

[-- Attachment #1: Type: text/plain, Size: 1604 bytes --]

Hello Derek,

On Tuesday 23 August 2011 06:30:13 Derek wrote:
> I found 'virsh edit' is the recommended way to make changes to a VM
> configuration, the XML file is not referenced at boot, it is only saved to
> with 'virsh dumpxml'.  'virsh edit' will update both areas - hypervisor and
> XML file.
>
> Unfortunately the changes I make for smbios and sysinfo (as below) while
> editing don't appear to be accepted when saving with 'virsh edit'.  I
> wonder if they are perhaps not supported with virsh edit yet?

If your domain is running, you get the config from the CURRENTLY RUNNING kvm 
process, but it is saved for the NEXT start. Just shutdown your current 
domain and restart it; rebooting from inside the domain (Ctrl-Alt-Del) is not 
enough, since a new kvm process needs to be forked.

> Does anyone have experience with this, or an idea on why I would receive
> 'bad file descriptor' errors using the kvm command manually.

Perhaps you should switch over to the libvirt-ML.

Sincerely
Philipp Hahn
-- 
Philipp Hahn           Open Source Software Engineer      hahn@univention.de
Univention GmbH        Linux for Your Business        fon: +49 421 22 232- 0
Mary-Somerville-Str.1  D-28359 Bremen                 fax: +49 421 22 232-99
                                                   http://www.univention.de/
----------------------------------------------------------------------------
Treffen Sie Univention auf der IT&Business vom 20. bis 22. September 2011
auf dem Gemeinschaftsstand der Open Source Business Alliance in Stuttgart in
Halle 3 Stand 3D27-7.

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-08-23  6:45 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-22  3:52 DMI BIOS String Derek
2011-08-22  9:45 ` Daniel P. Berrange
2011-08-22 11:55 ` Andrew Cathrow
2011-08-22 20:03   ` Ryan Harper
2011-08-22 23:55     ` Derek
2011-08-23  4:30       ` Derek
2011-08-23  6:45         ` Philipp Hahn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox