Re: bhyve graphics support

2016-05-27 Thread Shawn Webb
On Fri, May 27, 2016 at 10:48:54AM -0700, Michael Dexter wrote:
> On 5/27/16 1:33 AM, Peter Grehan wrote:
> > As of r300829, support for graphic output has been checked into the
> > projects/bhyve_graphics branch...
> 
> HUGE thanks to Leon and Peter for making this happen. We all owe them 
> our gratitude as with all things bhyve, this is non-trivial code.
> 
> There is a dedicated UEFI page on the wiki that would be suitable for 
> the FAQ's that are starting to appear on this thread. I will sync it 
> with Peter's original message and welcome others to contribute:
> 
> https://wiki.freebsd.org/bhyve/UEFI
> 
> I tested every major GNU/Linux distribution and a few variants and 
> Windows up through 2016 TP5. The results have been great but I'm sure 
> there are edge cases that need addressing. Please do test this with high 
> CPU counts, RAM allocations and anything else you can think of.

I'd like to echo Michael Dexter's appreciation. Peter, Michael, and
everyone else who worked on this: thank you so much.

I've imported the new bhyve code into a feature branch of HardenedBSD.
I'm glad to report that it's working flawlessly, even when compiled with
PIE + RELRO + BIND_NOW.

Here's a little screenshot showing CentOS getting installed:
https://photos.google.com/share/AF1QipPKqcVSwcPYxqEmfjXFJaMojL09ltTqmMsj-KXwdVftUL1BQQIfAApJrp8js4OMuQ?key=bG9YOE5ubS0yOEFrdmlqZ0x4eGw4OUFLTDZlUkln

Thanks,

-- 
Shawn Webb
Cofounder and Security Engineer
HardenedBSD

GPG Key ID:  0x6A84658F52456EEE
GPG Key Fingerprint: 2ABA B6BD EF6A F486 BE89  3D9E 6A84 658F 5245 6EEE


signature.asc
Description: PGP signature


Re: bhyve graphics support

2016-05-27 Thread Michael Dexter

On 5/27/16 1:33 AM, Peter Grehan wrote:

As of r300829, support for graphic output has been checked into the
projects/bhyve_graphics branch...


HUGE thanks to Leon and Peter for making this happen. We all owe them 
our gratitude as with all things bhyve, this is non-trivial code.


There is a dedicated UEFI page on the wiki that would be suitable for 
the FAQ's that are starting to appear on this thread. I will sync it 
with Peter's original message and welcome others to contribute:


https://wiki.freebsd.org/bhyve/UEFI

I tested every major GNU/Linux distribution and a few variants and 
Windows up through 2016 TP5. The results have been great but I'm sure 
there are edge cases that need addressing. Please do test this with high 
CPU counts, RAM allocations and anything else you can think of.


All the best,

Michael Dexter
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: bhyve graphics support

2016-05-27 Thread Roman Bogorodskiy
  Peter Grehan wrote:

> Hi Roman,
> 
> > I've just tried to do a Fedora installation and it worked like a charm.
> >
> > A couple of questions:
> >
> >  * There was a limitation that AHCI devices must use slots 3-6. [1]
> >Is it still there? If yes, any plans to get rid of it?
> 
>   It's not a limitation for guests that can use MSI for AHCI. Older 
> versions of Windows use legacy interrupts, but I noticed that 2k16 (and 
> maybe recent builds of 10) are using now using MSI.
> 
>   The real fix is to have more flexible ACPI DSDT generation from inside 
> of UEFI, but that's a non-trivial project.
> 
> >  * It *seems* that now it's OK to cycle a VM this way:
> >
> >host# bhyve ...
> >guest# reboot # guest goes away
> >host# bhyve ... # run it again
> >
> >Previously (with bhyveload) it didn't work (for me at least) without
> >doing "bhyvectl --destroy". Is it safe now not to call "bhyvectl
> >--destroy" before the second run now?
> 
>   Yes, except for the case when you modify the amount of memory given to 
> the guest - then you will need to delete prior to the run with the new 
> config.

Got it, thanks!

Roman Bogorodskiy


signature.asc
Description: PGP signature


Re: bhyve graphics support

2016-05-27 Thread Peter Grehan

Hi Roman,


I've just tried to do a Fedora installation and it worked like a charm.

A couple of questions:

 * There was a limitation that AHCI devices must use slots 3-6. [1]
   Is it still there? If yes, any plans to get rid of it?


 It's not a limitation for guests that can use MSI for AHCI. Older 
versions of Windows use legacy interrupts, but I noticed that 2k16 (and 
maybe recent builds of 10) are using now using MSI.


 The real fix is to have more flexible ACPI DSDT generation from inside 
of UEFI, but that's a non-trivial project.



 * It *seems* that now it's OK to cycle a VM this way:

   host# bhyve ...
   guest# reboot # guest goes away
   host# bhyve ... # run it again

   Previously (with bhyveload) it didn't work (for me at least) without
   doing "bhyvectl --destroy". Is it safe now not to call "bhyvectl
   --destroy" before the second run now?


 Yes, except for the case when you modify the amount of memory given to 
the guest - then you will need to delete prior to the run with the new 
config.


later,

Peter.

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: bhyve graphics support

2016-05-27 Thread Roman Bogorodskiy
  Peter Grehan wrote:

> As of r300829, support for graphic output has been checked into the 
> projects/bhyve_graphics branch. This is just the usr.sbin/bhyve 
> executable, so is quick and easy to build from source.
> 
> Assuming a reasonably current source tree is in /usr/src,
>svn co http://svn.freebsd.org/base/projects/bhyve_graphics path/to/dir
>cd path/to/dir
>make BHYVE_SYSDIR=/usr/src -m /usr/src/share/mk
> 
> UEFI GOP support has been checked into the freebsd/edk2 repo:
>  
> https://github.com/freebsd/uefi-edk2/commit/a36132939e259df79b16699c03c6f1d63c7454b9
> 
> A pre-built bhyve/UEFI binary image with GOP support is available at:
>https://people.freebsd.org/~grehan/bhyve_uefi/BHYVE_UEFI_20160526.fd
> 
> The new bhyve executable supports some new devices. An example of using 
> them for Windows10 is:
> 
> bhyve \
> -c 2 \
> -s 3,ahci-cd,/images/win10_install.iso \
> -s 4,ahci-hd,/images/win10.img \
> -s 11,fbuf,tcp=0.0.0.0:5900,w=1600,h=900,wait \
> -s 20,xhci,tablet \
> -s 31,lpc \
> -l bootrom,/images/BHYVE_UEFI_20160526.fd \
> -m 2G -H -w \
> windows

This is really great, thanks a lot to everyone who helped that happen!

I've just tried to do a Fedora installation and it worked like a charm.

A couple of questions:

 * There was a limitation that AHCI devices must use slots 3-6. [1]
   Is it still there? If yes, any plans to get rid of it?
 * It *seems* that now it's OK to cycle a VM this way:

   host# bhyve ...
   guest# reboot # guest goes away
   host# bhyve ... # run it again

   Previously (with bhyveload) it didn't work (for me at least) without
   doing "bhyvectl --destroy". Is it safe now not to call "bhyvectl
   --destroy" before the second run now?

Thanks again, really glad to see this feature :-)

1: https://wiki.freebsd.org/bhyve/Windows

Roman Bogorodskiy


signature.asc
Description: PGP signature


Re: bhyve graphics support

2016-05-27 Thread Peter Grehan

Hi Yamagi,


As far as I know UEFI supports ahci-* boot devices only. For the basic
UEFI support without GOP the AHCI devices needed to be mapped on slot 3
and 4. I don't know if that's still the case.


 Depends on the o/s being booted - if it needs legacy interrupt 
support, the only available slots with routing set up are 3/4/5/6.


 UEFI operates in polled-mode so it has no constraints on it's own.


I've got working VNC access to a FreeBSD 10.3 VM. My Windows 7 install
disc starts up, but the mouse is not working. Keystrokes through VNC
give "atkbd data buffer full" errors. I'll open a new thread for that
if I can't figure it out.


 XHCI isn't in Windows7 so you can just remove that config line, 
pushing mouse input through the PS2 mouse.


later,

Peter.

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: bhyve graphics support

2016-05-27 Thread Peter Grehan

Hi Lars,


-s 3:0,virtio-blk,./ubuntu-hd.img \

 ...

Then I connect with vncviewer but only see this message:

"Boot failed. EFI misc device"


 Which Ubuntu version/image is this ?

later,

Peter.

___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: bhyve graphics support

2016-05-27 Thread Yamagi Burmeister
> > > grub-bhyve -m device.map -r hd0,msdos1 -M 4G ubuntu
> > > ~lars/dev/bhyve_graphics/bhyve \
> > > -s 0:0,hostbridge \
> > > -s 1:0,lpc \
> > > -s 2:0,virtio-net,tap1 \
> > > -s 3:0,virtio-blk,./ubuntu-hd.img \
> > > -s 11,fbuf,tcp=0.0.0.0:5900,w=1280,h=720,wait \
> > > -s 20,xhci,tablet \
> > > -l bootrom,/home/lars/dev/bhyve_graphics/BHYVE_UEFI_20160526.fd \
> > > -c 4 \
> > > -m 4G \
> > > ubuntu

As far as I know UEFI supports ahci-* boot devices only. For the basic
UEFI support without GOP the AHCI devices needed to be mapped on slot 3
and 4. I don't know if that's still the case.

I've got working VNC access to a FreeBSD 10.3 VM. My Windows 7 install
disc starts up, but the mouse is not working. Keystrokes through VNC 
give "atkbd data buffer full" errors. I'll open a new thread for that
if I can't figure it out.

Regards,
Yamagi

-- 
Homepage:  www.yamagi.org
XMPP:  yam...@yamagi.org
GnuPG/GPG: 0xEFBCCBCB
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: bhyve graphics support

2016-05-27 Thread Lars Engels
On Fri, May 27, 2016 at 09:11:16PM +1000, Jason Tubnor wrote:
> On 27 May 2016 8:44 PM, "Lars Engels"  wrote:
> >
> >
> > downloading the UEFI image I start Ubuntu like this:
> >
> > grub-bhyve -m device.map -r hd0,msdos1 -M 4G ubuntu
> > ~lars/dev/bhyve_graphics/bhyve \
> > -s 0:0,hostbridge \
> > -s 1:0,lpc \
> > -s 2:0,virtio-net,tap1 \
> > -s 3:0,virtio-blk,./ubuntu-hd.img \
> > -s 11,fbuf,tcp=0.0.0.0:5900,w=1280,h=720,wait \
> > -s 20,xhci,tablet \
> > -l bootrom,/home/lars/dev/bhyve_graphics/BHYVE_UEFI_20160526.fd \
> > -c 4 \
> > -m 4G \
> > ubuntu
> >
> >
> > Then I connect with vncviewer but only see this message:
> >
> > "Boot failed. EFI misc device"
> 
> I don't think you need the grub shim with uefi.

That might be, but removing the grug-bhyve call doesn't change the error
message.


pgpe4RiZj1Vhh.pgp
Description: PGP signature


[Bug 202321] [bhyve, patch] More verbose error reporting in bhyve for backing images

2016-05-27 Thread bugzilla-noreply
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=202321

--- Comment #3 from commit-h...@freebsd.org ---
A commit references this bug:

Author: bapt
Date: Fri May 27 11:46:54 UTC 2016
New revision: 300843
URL: https://svnweb.freebsd.org/changeset/base/300843

Log:
  Improve error message when failing to open a backing file

  When bhyve cannot open a backing file, it now says explicitly which file
  could not be opened

  Note that the change has only be maed in block_if.c and not in
  pci_virtio_block.c as the error will always be catched by the first

  PR:   202321 (different patch)
  Reviewed by:  grehan
  MFC after:3 day
  Sponsored by: Gandi.net
  Differential Revision:https://reviews.freebsd.org/D6576

Changes:
  head/usr.sbin/bhyve/block_if.c

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: bhyve graphics support

2016-05-27 Thread Jason Tubnor
On 27 May 2016 8:44 PM, "Lars Engels"  wrote:
>
>
> downloading the UEFI image I start Ubuntu like this:
>
> grub-bhyve -m device.map -r hd0,msdos1 -M 4G ubuntu
> ~lars/dev/bhyve_graphics/bhyve \
> -s 0:0,hostbridge \
> -s 1:0,lpc \
> -s 2:0,virtio-net,tap1 \
> -s 3:0,virtio-blk,./ubuntu-hd.img \
> -s 11,fbuf,tcp=0.0.0.0:5900,w=1280,h=720,wait \
> -s 20,xhci,tablet \
> -l bootrom,/home/lars/dev/bhyve_graphics/BHYVE_UEFI_20160526.fd \
> -c 4 \
> -m 4G \
> ubuntu
>
>
> Then I connect with vncviewer but only see this message:
>
> "Boot failed. EFI misc device"

I don't think you need the grub shim with uefi.

Cheers,

Jason
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: bhyve graphics support

2016-05-27 Thread Lars Engels
On Fri, May 27, 2016 at 01:33:42AM -0700, Peter Grehan wrote:
> As of r300829, support for graphic output has been checked into the 
> projects/bhyve_graphics branch. This is just the usr.sbin/bhyve 
> executable, so is quick and easy to build from source.
> 
> Assuming a reasonably current source tree is in /usr/src,
>svn co http://svn.freebsd.org/base/projects/bhyve_graphics path/to/dir
>cd path/to/dir
>make BHYVE_SYSDIR=/usr/src -m /usr/src/share/mk
> 
> UEFI GOP support has been checked into the freebsd/edk2 repo:
>  
> https://github.com/freebsd/uefi-edk2/commit/a36132939e259df79b16699c03c6f1d63c7454b9
> 
> A pre-built bhyve/UEFI binary image with GOP support is available at:
>https://people.freebsd.org/~grehan/bhyve_uefi/BHYVE_UEFI_20160526.fd
> 
> The new bhyve executable supports some new devices. An example of using 
> them for Windows10 is:
> 
> bhyve \
> -c 2 \
> -s 3,ahci-cd,/images/win10_install.iso \
> -s 4,ahci-hd,/images/win10.img \
> -s 11,fbuf,tcp=0.0.0.0:5900,w=1600,h=900,wait \
> -s 20,xhci,tablet \
> -s 31,lpc \
> -l bootrom,/images/BHYVE_UEFI_20160526.fd \
> -m 2G -H -w \
> windows

Thanks for your work on this!

With Ubuntu 16.04 I was not successful so far. After compiling bhyve and
downloading the UEFI image I start Ubuntu like this:

grub-bhyve -m device.map -r hd0,msdos1 -M 4G ubuntu
~lars/dev/bhyve_graphics/bhyve \
-s 0:0,hostbridge \
-s 1:0,lpc \
-s 2:0,virtio-net,tap1 \
-s 3:0,virtio-blk,./ubuntu-hd.img \
-s 11,fbuf,tcp=0.0.0.0:5900,w=1280,h=720,wait \
-s 20,xhci,tablet \
-l bootrom,/home/lars/dev/bhyve_graphics/BHYVE_UEFI_20160526.fd \
-c 4 \
-m 4G \
ubuntu


Then I connect with vncviewer but only see this message:

"Boot failed. EFI misc device"

Is there anything I can try?


pgpZDByStLQd2.pgp
Description: PGP signature


Re: bhyve graphics support

2016-05-27 Thread K. Macy
Yes.

-M

On Friday, May 27, 2016, Peter Grehan  wrote:

> Cool stuff. FYI new i915 driver has vgpu support, incliuding 3D.
>>
>
>  Is that the KVM-GT work ? (https://github.com/01org/KVMGT-kernel)
>
>  If so, yes, it would be great to support that in bhyve.
>
> later,
>
> Peter.
>
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: bhyve graphics support

2016-05-27 Thread Peter Grehan

Cool stuff. FYI new i915 driver has vgpu support, incliuding 3D.


 Is that the KVM-GT work ? (https://github.com/01org/KVMGT-kernel)

 If so, yes, it would be great to support that in bhyve.

later,

Peter.
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


Re: bhyve graphics support

2016-05-27 Thread K. Macy
Cool stuff. FYI new i915 driver has vgpu support, incliuding 3D.

On Friday, May 27, 2016, Peter Grehan  wrote:

> As of r300829, support for graphic output has been checked into the
> projects/bhyve_graphics branch. This is just the usr.sbin/bhyve executable,
> so is quick and easy to build from source.
>
> Assuming a reasonably current source tree is in /usr/src,
>   svn co http://svn.freebsd.org/base/projects/bhyve_graphics path/to/dir
>   cd path/to/dir
>   make BHYVE_SYSDIR=/usr/src -m /usr/src/share/mk
>
> UEFI GOP support has been checked into the freebsd/edk2 repo:
>
>
> https://github.com/freebsd/uefi-edk2/commit/a36132939e259df79b16699c03c6f1d63c7454b9
>
> A pre-built bhyve/UEFI binary image with GOP support is available at:
>   https://people.freebsd.org/~grehan/bhyve_uefi/BHYVE_UEFI_20160526.fd
>
> The new bhyve executable supports some new devices. An example of using
> them for Windows10 is:
>
> bhyve \
>-c 2 \
>-s 3,ahci-cd,/images/win10_install.iso \
>-s 4,ahci-hd,/images/win10.img \
>-s 11,fbuf,tcp=0.0.0.0:5900,w=1600,h=900,wait \
>-s 20,xhci,tablet \
>-s 31,lpc \
>-l bootrom,/images/BHYVE_UEFI_20160526.fd \
>-m 2G -H -w \
>windows
>
>  The framebuffer device, "fbuf", takes parameters describing the VNC
> server options. The optional "wait" parameter will hold execution of the
> guest until a VNC client is connected. The height and width of the frame
> buffer can be specified, with the constraints that the maximum is 1920x1200.
>
> Arbitrary resolutions are not yet supported by UEFI. That will be fixed,
> but in the meantime, available resolutions are:
>  1920 x 1200
>  1920 x 1080
>  1600 x 1200
>  1600 x 900
>  1280 x 1024
>  1280 x 720
>  1024 x 768
>   800 x 600
>   640 x 480
>  Specifying an unsupported resolution will result in UEFI falling back to
> 800x600.
>
> The XHCI emulation currently only has a tablet back end. This connects to
> pointer input from VNC. If not present, pointer input defaults to the ps2
> mouse emulation. Note the latter only suppports relative coordinates which
> don't track the cursor very well in VNC.
>
> Keyboard input currently defaults to the PS2 keyboard.
>
> The code has been tested with Windows 7/8/8.1/10 and Server 2k12/2k16,
> Ubuntu 15.10, and FreeBSD 10.3/11-CURRENT. Note that older versions of
> Windows, and FreeBSD, don't like the XHCI tablet - the default ps2 mouse
> should be used with those.
>
>  For VNC clients, TightVNC, TigherVNC, and RealVNC (aka VNC Viewer) have
> been tested on various hosts. The OSX VNC client is known not to work.
>
>  Give it a try and let us know how it goes !
>
>  Many thanks to Michael Dexter for helping out with the testing of this.
>
> later,
>
> Peter.
> ___
> freebsd-virtualization@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
> To unsubscribe, send any mail to "
> freebsd-virtualization-unsubscr...@freebsd.org"
>
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"


bhyve graphics support

2016-05-27 Thread Peter Grehan
As of r300829, support for graphic output has been checked into the 
projects/bhyve_graphics branch. This is just the usr.sbin/bhyve 
executable, so is quick and easy to build from source.


Assuming a reasonably current source tree is in /usr/src,
  svn co http://svn.freebsd.org/base/projects/bhyve_graphics path/to/dir
  cd path/to/dir
  make BHYVE_SYSDIR=/usr/src -m /usr/src/share/mk

UEFI GOP support has been checked into the freebsd/edk2 repo:

https://github.com/freebsd/uefi-edk2/commit/a36132939e259df79b16699c03c6f1d63c7454b9

A pre-built bhyve/UEFI binary image with GOP support is available at:
  https://people.freebsd.org/~grehan/bhyve_uefi/BHYVE_UEFI_20160526.fd

The new bhyve executable supports some new devices. An example of using 
them for Windows10 is:


bhyve \
   -c 2 \
   -s 3,ahci-cd,/images/win10_install.iso \
   -s 4,ahci-hd,/images/win10.img \
   -s 11,fbuf,tcp=0.0.0.0:5900,w=1600,h=900,wait \
   -s 20,xhci,tablet \
   -s 31,lpc \
   -l bootrom,/images/BHYVE_UEFI_20160526.fd \
   -m 2G -H -w \
   windows

 The framebuffer device, "fbuf", takes parameters describing the VNC 
server options. The optional "wait" parameter will hold execution of the 
guest until a VNC client is connected. The height and width of the frame 
buffer can be specified, with the constraints that the maximum is 1920x1200.


Arbitrary resolutions are not yet supported by UEFI. That will be fixed, 
but in the meantime, available resolutions are:

 1920 x 1200
 1920 x 1080
 1600 x 1200
 1600 x 900
 1280 x 1024
 1280 x 720
 1024 x 768
  800 x 600
  640 x 480
 Specifying an unsupported resolution will result in UEFI falling back 
to 800x600.


The XHCI emulation currently only has a tablet back end. This connects 
to pointer input from VNC. If not present, pointer input defaults to the 
ps2 mouse emulation. Note the latter only suppports relative coordinates 
which don't track the cursor very well in VNC.


Keyboard input currently defaults to the PS2 keyboard.

The code has been tested with Windows 7/8/8.1/10 and Server 2k12/2k16, 
Ubuntu 15.10, and FreeBSD 10.3/11-CURRENT. Note that older versions of 
Windows, and FreeBSD, don't like the XHCI tablet - the default ps2 mouse 
should be used with those.


 For VNC clients, TightVNC, TigherVNC, and RealVNC (aka VNC Viewer) 
have been tested on various hosts. The OSX VNC client is known not to work.


 Give it a try and let us know how it goes !

 Many thanks to Michael Dexter for helping out with the testing of this.

later,

Peter.
___
freebsd-virtualization@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-virtualization
To unsubscribe, send any mail to 
"freebsd-virtualization-unsubscr...@freebsd.org"