News for hackers. Stuff that matters.
Re:Building a CustoMac: Buyer's Guide October 2016 by xaduha on Sunday October 30, 2016 @08:25AM (#12829410)
Alternative route is to build a VFIO capable computer and run OS X or whatever your heart desires in a VM with real hardware (read GPU) passed through.

You can even run several VMs with several GPUs at the same time. Essentially you can have 2+ computers at the price of one.

Re:Building a CustoMac: Buyer's Guide October 2016 by dperfect on Sunday October 30, 2016 @12:06PM (#12830518)
I use a configuration like this (with Proxmox) to send content to the various TVs in my house (HDMI over Cat 5e). 4 cheap GPUs in the machine allow for up to 4 VMs running OS X (my preferred OS for media) to simultaneously play HD content, run classic emulated games, web browsing, etc. (haven't bothered with UHD yet, and probably won't for a while).

Of course, a lot of HD content can run with very modest specs (as long as the codecs are accelerated on the GPU), but for occasional content that requires CPU decoding or players/sites that aren't yet supported on standalone devices (Apple TV, Roku, etc), it's a really nice solution. Plus, it keeps each TV very clean in terms of cables and hardware.

I've done hackintosh on bare metal in the past, but even if I were setting up a single-headed hackintosh now, I'd still go the VFIO route - it makes updates much less stressful since you can quickly roll back to a snapshot if you break something.

Re:Building a CustoMac: Buyer's Guide October 2016 by weitzj on Sunday October 30, 2016 @02:49PM (#12831514)
Do you have this configuration by chance as a GIST on GitHub? There are KVM/Qemu configurations, but especially ProxMox would be nice
Re:Building a CustoMac: Buyer's Guide October 2016 by dperfect on Sunday October 30, 2016 @09:57PM (#12833779)
Kind of a late response, but here are the basics of my setup (maybe I'll publish some specifics in a gist at some point):

- Hardware (which is dated now): Asus Z87 Pro with i7 4770, 16 GB Memory, 4x AMD Radeon 6450 cards (< $20/ea used)

- Proxmox/host config: vfiobind the PCI device IDs for graphics cards on boot, slightly modified pve-q35.cfg (workaround for some OS X issues on q35), using fairly standard VM args for booting OS X

- GPUs work fine after a standard OS X install, but to get audio working over HDMI, I needed a couple of edits to my DSDT (basically just inserting a GFX0 device with "hda-gfx" = "onboard-1", a standard HDAU device, and a DTGP device), and boot with the Enoch bootloader (this can be specified in the VM args to avoid having to install to disk). No extra kexts needed.

That's about it. Some of those things may no longer be necessary in the latest version of Proxmox (I haven't updated my base system in a while). Once I got things working, it's been completely stable for more than a year.

Re:Building a CustoMac: Buyer's Guide October 2016 by mountaineer22 on Sunday October 30, 2016 @02:51PM (#12831524)
What is your hardware setup like? How much physical RAM and what mobo/GPUs?
Re:Building a CustoMac: Buyer's Guide October 2016 by toredash on Sunday October 30, 2016 @03:09PM (#12831624)
How do you do input to the different VMs/TVs?
Re:Building a CustoMac: Buyer's Guide October 2016 by dperfect on Sunday October 30, 2016 @10:13PM (#12833839)
It's a bit overkill (that's what we do as engineers though, right?) - I have a Raspberry Pi attached to the back of each TV that receives input from a small Bluetooth keyboard/trackpad/remote and passes the input (over UDP) to the appropriate VM.

Depending on the environment, wireless devices could be used with separate USB receivers (e.g. Bluetooth adapters) for each screen (passed directly to the VMs), but the distance in my setup was proving to be a bit too far for a stable Bluetooth connection.

I'm just using some of my own scripts right now to configure everything and allow for some meta commands (things like powering on/off the TV, switching inputs, etc). I'd love to clean it up and publish it at some point, but just haven't had the time.

Re:Building a CustoMac: Buyer's Guide October 2016 by CPLX on Sunday October 30, 2016 @08:41AM (#12829464)
This sounds interesting. Know of any unusually good guides/resources for this?
Re:Building a CustoMac: Buyer's Guide October 2016 by xaduha on Sunday October 30, 2016 @09:00AM (#12829549)
I can't judge from the beginners standpoint, here are few places to start looking

https://nixos.org/wiki/QEMU_guest_with_VGA_passthrough

https://www.reddit.com/r/VFIO

https://www.reddit.com/r/unRAID

https://wiki.archlinux.org/index.php/PCI_passthrough_via_OVM...

I'd recommend going with NixOS and libvirt, but other communities such as around unRAID or Arch might be bigger.

Re:Building a CustoMac: Buyer's Guide October 2016 by mountaineer22 on Sunday October 30, 2016 @09:16AM (#12829611)
Can you describe your current setup(HW/OS)?
Re:Building a CustoMac: Buyer's Guide October 2016 by xaduha on Sunday October 30, 2016 @09:38AM (#12829707)
i7-3770 (no K), ATI GPU, Gigabyte B75-D3V board. I boot into NixOS without X server and launch a Windows VM with libvirt using this config (redacted a bit).

https://gist.github.com/xaduha/226ff1b991bd54db09ff0bbd1df79...

snapshot=on option allows me to discard changes to the image with every launch, folders like Desktop, Downloads, etc are not part of the image.

When I do need to keep the changes I use a commit command, not mucking with actual snapshots anymore.

$ virsh qemu-monitor-command MAIN --hmp commit all

As for macOS VM, I haven't used one recently, but it's totally possible.

Re:Building a CustoMac: Buyer's Guide October 2016 by rcarmo on Sunday October 30, 2016 @12:12PM (#12830546)
That's nice, but further down the thread you say you haven't tried OSX at all. Anyone else have a useful data point for this scenario?
Re:Building a CustoMac: Buyer's Guide October 2016 by xaduha on Sunday October 30, 2016 @12:41PM (#12830713)
You misread, I said I haven't tried it recently, as in I haven't tried it with macOS Sierra.

https://www.youtube.com/watch?v=qadiAp1aiJM

https://github.com/kholia/OSX-KVM

Re:Building a CustoMac: Buyer's Guide October 2016 by rcarmo on Sunday October 30, 2016 @12:56PM (#12830799)
Thanks for the links!
Re:Building a CustoMac: Buyer's Guide October 2016 by jrcii on Sunday October 30, 2016 @08:42AM (#12829466)
You can run OS X with qemu on Linux.
Re:Building a CustoMac: Buyer's Guide October 2016 by rcarmo on Sunday October 30, 2016 @12:13PM (#12830548)
It crawls, even under KVM.
Re:Building a CustoMac: Buyer's Guide October 2016 by Hydraulix989 on Sunday October 30, 2016 @01:10PM (#12830890)
Is qemu better than KVM? Currently using KVM and the performance is to be desired.
Re:Building a CustoMac: Buyer's Guide October 2016 by xaduha on Sunday October 30, 2016 @12:47PM (#12830749)
It runs fine, you probably misconfigured something.
Re:Building a CustoMac: Buyer's Guide October 2016 by rcarmo on Sunday October 30, 2016 @12:52PM (#12830779)
"fine" for me encompasses fluid rendering of the interface.
Re:Building a CustoMac: Buyer's Guide October 2016 by xaduha on Sunday October 30, 2016 @01:01PM (#12830839)
It's pretty damn fluid with real GPU passed through, literally no difference compared to running on bare metal.

If you're not passing a real GPU then you're doing it wrong and shouldn't expect much anyway.

Re:Building a CustoMac: Buyer's Guide October 2016 by Hydraulix989 on Sunday October 30, 2016 @01:10PM (#12830896)
Are you using VMware for this?
Re:Building a CustoMac: Buyer's Guide October 2016 by xaduha on Sunday October 30, 2016 @01:20PM (#12830953)
I'm using kvm, which is basically qemu with hardware acceleration. VT-x is minimum, VT-d is better.

Also by default qemu/kvm only uses one processor core I think, what are using to launch it? A script?

Re:Building a CustoMac: Buyer's Guide October 2016 by Hydraulix989 on Sunday October 30, 2016 @02:35PM (#12831434)
Are you able to pass through USB devices?
Re:Building a CustoMac: Buyer's Guide October 2016 by xaduha on Sunday October 30, 2016 @02:44PM (#12831479)
I have VT-d, so for me it's more convenient to pass a whole USB controller, not individual devices. But I did pass USB devices in the past, yes.