Boot2docker VM graphics - macos

Boot2docker is a lightweight Linux distribution running in VirtualBox VM. All basic functionality works fine, I am able to use docker containers in MacOS X.
However my application requires OpenGL rendering and I cannot get it working.
How do I control which graphics acceleration is used inside that VirtualBox VM? I want to completely remove any 3D acceleration functions, because Mesa software drivers should just work perfectly (tested on VMware VM).
Is there a way to control boot2docker VM graphics settings like I do for normal VirtualBox VMs?

I'd say the most straightforward way (and I'd place this as a feature/bug request with the boo2docker devs) would be to install a pure Mesa llvm softpipe build for OpenGL. This should give you OSMesa. However for a classical OpenGL context you'll probably need some kind of X server (until EGL / offscreen Wayland works satisfactory). A X.org server with a dummy device should work perfectly, as long as you use framebuffer objects.

It turns out that boot2docker is just a wrapper around the VBoxManage command.
And if you really want to, you can control the VM created by boot2docker using VBoxManage command - you can change 3D graphics acceleration, VMem, etc.

Related

Possible run MacOS on Hyper-V without nested virtualization?

Now i develop Xamarin application on my Hyper-V workstation. I'm using nested virtualization to host MacOS Mojave on Ubuntu host.
I write small project describe this https://github.com/vkorotenko/MacOSMojaveOnHyper-V
But i have some problem. To many virtualization and no HW accelerated video.
Possible or not run MacOS on Hyper-V with hardware video acceleration without nested virtualization?
I searched several forums and it seems that it is not supported by Apple. Thus, there is some instable projects to do so.
You may search for images on Google, but it is far easier to find stable versions for VMWare and VirtualBox. The reason is that HyperV is a closer to metal virtualization that is specific to Microsoft and harder to deploy for hackers than a classical virtual machine.
I understand that you may want to use HyperV since many other dev tools requires it. Docker and WSL are good examples.
Another option is to rely on Hackintosh to install your MacOS on bar metal, by making a partition of your disk. This will be the closest to native performances and behavior.
All of this is NOT supported by Apple EULA and thus I will not provide any link. But it is easy to find.

OSX Docker Image on OSX Host?

Im well aware that i cannot run an OSX docker image on a linux or window host because they are totally different operating systems, but is it possible to have a OSX-based Docker image running ON an OSX host?
I would love to be able to utilize this for automating iOS application build processes.
Docker uses Linux kernel to make use of containerisation. Since MacOS uses a different kernel, this is not natively possible.
However, there are some approaches that you could try.

Can I use my GPU from a docker container on a MacBook Pro ? (AMD Radeon GPU)

I would like to run a GPU enabled app (Gazebo) inside a docker container on my MacBook Pro.
I seemed to me, through my research, that about a year ago, Docker released a native Docker app for MacOS.
Before that, Docker used to spawn an entire Linux VM and run the container on top of it.
Now, it apparently uses some native hypervisor framework, making it more optimized and closer to the hardware, changing entirely Docker's approach to containerization on a Mac.
All this is not very clear to me and I am not sure of everything I stated.
Is it now possible to use my macbook pro's GPU from a docker container, and, if yes, how ?
The command line I'm using right now, which works for regular X11 apps but not GPU-enabled apps like Gazebo is:
xhost +
docker run -it -e DISPLAY=$ip:0 -v /tmp/.X11-unix:/tmp/.X11-unix image_name bash
There's still a virtual machine involved.
Docker for Mac uses a virtualization layer called XHyve. It's a lot thinner and more lightweight than VirtualBox or such (emulates fewer peripherals), but it's still virtualization.
PCI passthrough is (theoretically) possible, but you can't pass through your laptop's main GPU and still use it.
Hardware with an IOMMU (and yes, your MacBook Pro has an Intel chipset with such support) can allow a virtualized environment direct access to PCI hardware.
However, you can't cede control of a piece of hardware to a VM and still use that hardware from the host. (Some high-end server network cards work around this by having multiple PCI endpoints, so the host and each guest gets a different endpoint to talk to).
So -- you could get an external Thunderbolt-attached GPU, and it might work... in the future.
The underlying support in Xhyve isn't there yet (as of this mid-2017 writing), and even on KVM (used by a lot of folks doing pioneering work here), there are only limited reports of success (with a specific video card -- the Radeon HD 5850).

Is there an App-V / Docker equivalent for Mac OSX?

Windows has a application-virtualisation tool called App-V.
Linux appears to have a similar tool called Docker.
My question is - is there a Docker equivalent for MacOS X? (ie without having to spin up a Linux virtual machine on VirtualBox?)
There is no strict analog for OS X. If you are against spinning up a virtual Linux machine, your options are:
A simple chroot jail. The jailkit utility can help you out with this.
For your own OS X applications, using App Sandbox to limit the resources your app has access to.
Again, neither of these is just like Docker 0.x, which uses LXC under the covers.
The chroot solution is closer, since it is one of the components that LXC is built on. However, it doesn't provide kernel namespaces or anything like cgroups — both of which are two very important parts of LXC.

Why can't you install docker natively in osx?

I would love to be able to use docker outside of Vagrant in OSX. Right now this is not possible. What are the specific reasons causing it not to be limited for linux installations only?
Docker is just an abstraction & automation layer on top of system-provided containers.
The technical limitation is that OS X does not support operating system-level virtualization, like containers in Linux or jails in FreeBSD (even despite the fact that OS X is a half-blood BSD).
But even despite that, Docker aims to provide an easy way to share container images, and to make sure that any Docker image would work on any Docker-compatible system, they had to limit it only to Linux. (That is probably why Docker doesn't support FreeBSD and friends, which do have containers.)
UPDATE: you can use projects like docker-osx or boot2docker to enjoy Docker on your OS X machine almost seamlessly (both create a Linux virtual machine behind the scenes.)

Resources