Bug#858962: [Pkg-xen-devel] Bug#858962: enabling OVMF - 4.10+

2018-02-28 Thread John Keates
Excellent! Good to see you got the serial console working as well. 
There are a bunch of extra options like allowing custom nvram per-vm (normally 
it’s just one read-only nvram for all instances),
but those aren’t important right now, basic EFI domu booting is pretty fair to 
get in Debian first.

John

> On 1 Mar 2018, at 00:14, Hans van Kranenburg  wrote:
> 
> Hey,
> 
> On 02/28/2018 12:59 AM, John Keates wrote:
>> 
>> [...]
>> 
>> 1. Install Xen with OVMF support
>> 2. Install OVMF (which basically just gets you the binary file, package is 
>> called ovmf)
>> 3. Get an EFI-bootable image, the Debian Netinstall image will probably do 
>> fine
>> 3. Create a domU config like this:
>> 
>> name = 'uefi-domu-thingy'
>> bios = "ovmf"
>> builder = 'hvm'
>> memory = '512'
>> vcpus = 1
>> 
>> Then sudo xl create 
>> 
>> This should start the domu, and since there is no disk, just get to the UEFI 
>> shell and idle around and not do much else. You can connect to it over VNC, 
>> but I’m sure it can be started in UEFI text mode too so you get UEFI access 
>> via the serial console.
> 
> Ok, as promised, I tried.
> 
> For Xen 4.10, I ended up with:
> 
> name = 'uefi-domu-thingy'
> bios = "ovmf"
> type = 'hvm'
> memory = '512'
> vcpus = 1
> vnc=1
> vnclisten='0.0.0.0'
> serial='pty'
> 
> I installed the qemu packages that Mark Pryor already rebuilt as test
> (which use libxen 4.10).
> 
> When doing xen create -c on that, I get a serial console to it:
> 
> UEFI Interactive Shell v2.2
> EDK II
> UEFI v2.70 (EDK II, 0x0001)
> Mapping table
> BLK0: Alias(s):
>  PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x0)
> BLK1: Alias(s):
>  PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x1)
> Press ESC in 1 seconds to skip startup.nsh or any other key to continue.
> Shell>
> 
> A vnc connection also shows an ugly screen which a copy of the output.
> 
> Step 2: Use a disk
> 
> I simply added...
> disk = ['file:/yolo/ovmf/debian-9.3.0-amd64-netinst.iso,xvda']
> 
> and now the serial console shows a purple blinking cursor, and the vnc
> connection shows a graphical Debian GNU/Linux UEFI Installer menu.
> 
> Great success!
> 
> Hans



Bug#858962: [Pkg-xen-devel] Bug#858962: enabling OVMF - 4.10+

2018-02-28 Thread Hans van Kranenburg
Hey,

On 02/28/2018 12:59 AM, John Keates wrote:
> 
> [...]
> 
> 1. Install Xen with OVMF support
> 2. Install OVMF (which basically just gets you the binary file, package is 
> called ovmf)
> 3. Get an EFI-bootable image, the Debian Netinstall image will probably do 
> fine
> 3. Create a domU config like this:
> 
> name = 'uefi-domu-thingy'
> bios = "ovmf"
> builder = 'hvm'
> memory = '512'
> vcpus = 1
> 
> Then sudo xl create 
> 
> This should start the domu, and since there is no disk, just get to the UEFI 
> shell and idle around and not do much else. You can connect to it over VNC, 
> but I’m sure it can be started in UEFI text mode too so you get UEFI access 
> via the serial console.

Ok, as promised, I tried.

For Xen 4.10, I ended up with:

name = 'uefi-domu-thingy'
bios = "ovmf"
type = 'hvm'
memory = '512'
vcpus = 1
vnc=1
vnclisten='0.0.0.0'
serial='pty'

I installed the qemu packages that Mark Pryor already rebuilt as test
(which use libxen 4.10).

When doing xen create -c on that, I get a serial console to it:

UEFI Interactive Shell v2.2
EDK II
UEFI v2.70 (EDK II, 0x0001)
Mapping table
 BLK0: Alias(s):
  PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x0)
 BLK1: Alias(s):
  PciRoot(0x0)/Pci(0x1,0x0)/Floppy(0x1)
Press ESC in 1 seconds to skip startup.nsh or any other key to continue.
Shell>

A vnc connection also shows an ugly screen which a copy of the output.

Step 2: Use a disk

I simply added...
disk = ['file:/yolo/ovmf/debian-9.3.0-amd64-netinst.iso,xvda']

and now the serial console shows a purple blinking cursor, and the vnc
connection shows a graphical Debian GNU/Linux UEFI Installer menu.

Great success!

Hans



Bug#858962: enabling OVMF - 4.10+

2018-02-27 Thread Hans van Kranenburg
On 28/02/2018 00:59, John Keates wrote:
> Here is how you can test it:
> 
> [...]

Thanks! This is really helpful. I'm going to try this tomorrow.

Hans



Bug#858962: [Pkg-xen-devel] Bug#858962: enabling OVMF - 4.10+

2018-02-27 Thread John Keates
HI Hans,

We probably should update the mailing list anyway since not everybody will be 
on GitLab anyway. Here is how you can test it:

1. Install Xen with OVMF support
2. Install OVMF (which basically just gets you the binary file, package is 
called ovmf)
3. Get an EFI-bootable image, the Debian Netinstall image will probably do fine
3. Create a domU config like this:

name = 'uefi-domu-thingy'
bios = "ovmf"
builder = 'hvm'
memory = '512'
vcpus = 1

Then sudo xl create 

This should start the domu, and since there is no disk, just get to the UEFI 
shell and idle around and not do much else. You can connect to it over VNC, but 
I’m sure it can be started in UEFI text mode too so you get UEFI access via the 
serial console.

If you want to test booting an OS, a simple way is starting debian. Grabbing 
the netinstall image works, add a disk stanza and there you go:

disk = ['file:/tmp/debian-9.3.0-amd64-netinst.iso,xvda’]

If you want to control the virtual frame buffer VNC setup:

vfb = ["type=vnc, vnclisten=0.0.0.0, vncpasswd=1337-haxx0r"]

If you also want to have some networking fun, you could add a virtual interface 
as normal:

vif = [ 'mac=00:16:3e:12:34:56, bridge=testlan0, script=vif-openvswitch, 
type=vif’]

By the way, if OVMF isn’t enabled or the ovmf.fd file doesn’t exist in the 
expected or configured path, it will error out.

- John

> On 28 Feb 2018, at 00:18, Hans van Kranenburg  wrote:
> 
> Hi John,
> 
> I don't think this will ever hit 4.8 in stable, but I want to have this
> in the new 4.10+ packages for unstable because you've been waiting long
> enough now.
> 
> Thanks for sending the Merge Request about this. Now the change will go
> in under your name. :)
> 
> I don't think that a discussion in gitlab on some commit that got
> rebased later is the best way, so let's continue here.
> 
> I know --enable-ovmf builds ok, now I need instructions to test this. I
> suspect you're on 4.8 and unless you have a spare test system already
> you might not want to be running random experimental test builds for
> 4.10. It also needs rebuilt qemu packages against xen 4.10.
> 
> So, what is the minimal set of things I can do to make sure the
> resulting build does something sensible? I have to be honest I'm not a
> qemu user myself, so I might not be totally familiar with all steps.
> 
> I see https://wiki.xenproject.org/wiki/OVMF which has an example, which
> also mentions use of a live CD.
> 
> Can you point me so something I can provide as a disk, and tell me if
> this is the right path to a minimal test to check that everything is
> working right?
> 
> Thanks,
> Hans
> 
> ___
> Pkg-xen-devel mailing list
> pkg-xen-de...@lists.alioth.debian.org
> http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-xen-devel



Bug#858962: enabling OVMF - 4.10+

2018-02-27 Thread Hans van Kranenburg
Hi John,

I don't think this will ever hit 4.8 in stable, but I want to have this
in the new 4.10+ packages for unstable because you've been waiting long
enough now.

Thanks for sending the Merge Request about this. Now the change will go
in under your name. :)

I don't think that a discussion in gitlab on some commit that got
rebased later is the best way, so let's continue here.

I know --enable-ovmf builds ok, now I need instructions to test this. I
suspect you're on 4.8 and unless you have a spare test system already
you might not want to be running random experimental test builds for
4.10. It also needs rebuilt qemu packages against xen 4.10.

So, what is the minimal set of things I can do to make sure the
resulting build does something sensible? I have to be honest I'm not a
qemu user myself, so I might not be totally familiar with all steps.

I see https://wiki.xenproject.org/wiki/OVMF which has an example, which
also mentions use of a live CD.

Can you point me so something I can provide as a disk, and tell me if
this is the right path to a minimal test to check that everything is
working right?

Thanks,
Hans