[pve-devel] [PATCH manager 3/3] ui: add 'win11' ostype and set defaults in wizard

DERUMIER, Alexandre Alexandre.DERUMIER at groupe-cyllene.com
Mon Oct 18 07:57:58 CEST 2021


Hi,

I don't think that win2022 require tpm , only win11.

Le lundi 11 octobre 2021 à 14:55 +0200, Stefan Reiter a écrit :
Windows 11 requires a TPM and secure boot, so try to auto-enable both.

Signed-off-by: Stefan Reiter <s.reiter at proxmox.com<mailto:s.reiter at proxmox.com>>
---
 www/manager6/Utils.js           |  1 +
 www/manager6/qemu/SystemEdit.js | 16 ++++++++++++++++
 2 files changed, 17 insertions(+)

diff --git a/www/manager6/Utils.js b/www/manager6/Utils.js
index ee92cd43..274d4db2 100644
--- a/www/manager6/Utils.js
+++ b/www/manager6/Utils.js
@@ -43,6 +43,7 @@ Ext.define('PVE.Utils', {
            { desc: '2.4 Kernel', val: 'l24' },
        ],
        'Microsoft Windows': [
+           { desc: '11/2022', val: 'win11' },
            { desc: '10/2016/2019', val: 'win10' },
            { desc: '8.x/2012/2012r2', val: 'win8' },
            { desc: '7/2008r2', val: 'win7' },
diff --git a/www/manager6/qemu/SystemEdit.js b/www/manager6/qemu/SystemEdit.js
index 8d178f06..f3e3fe9c 100644
--- a/www/manager6/qemu/SystemEdit.js
+++ b/www/manager6/qemu/SystemEdit.js
@@ -56,6 +56,20 @@ Ext.define('PVE.qemu.SystemInputPanel', {
            'pveQemuBiosSelector': {
                change: 'biosChange',
            },
+           '#': {
+               afterrender: 'setMachine',
+           },
+       },
+
+       setMachine: function() {
+           let me = this;
+           let vm = this.getViewModel();
+           let ostype = vm.get('current.ostype');
+           if (ostype === 'win11') {
+               me.lookup('machine').setValue('q35');
+               me.lookup('bios').setValue('ovmf');
+               me.lookup('addtpmbox').setValue(true);
+           }
        },
     },

@@ -71,6 +85,7 @@ Ext.define('PVE.qemu.SystemInputPanel', {
        {
            xtype: 'proxmoxKVComboBox',
            name: 'machine',
+           reference: 'machine',
            value: '__default__',
            fieldLabel: gettext('Machine'),
            comboItems: [
@@ -81,6 +96,7 @@ Ext.define('PVE.qemu.SystemInputPanel', {
        {
            xtype: 'pveQemuBiosSelector',
            name: 'bios',
+           reference: 'bios',
            value: '__default__',
            fieldLabel: 'BIOS',
        },



More information about the pve-devel mailing list