Virtualizing Media Center inside Hyper-V

A place to talk about GPUs/Motherboards/CPUs/Cases/Remotes, etc.
BlueScreenOfTOM

Posts: 15
Joined: Fri Apr 10, 2015 4:55 am
Location:

HTPC Specs: Show details

Virtualizing Media Center inside Hyper-V

#1

Post by BlueScreenOfTOM » Fri Apr 10, 2015 5:09 am

I've seen a couple threads on this, but no recent chat on it, so I thought I'd share my experiences.

I recently decided to simplify things a bit hardware-wise and install Windows 7 Ultimate x64 inside a Hyper-V VM on a Windows Server 2012 R2 box. I've been using WMC for the last 7 years or so without any issues and I'd like to continue using it, but I also wanted to reduce my hardware footprint a bit, so this seemed like the logical next step. I only view content through XBOX 360 extenders, so having a "headless" solution is not an issue for me. I used the Digital Cable Advisor bypass tool script (which just appears to change some registry settings) to allow me to use it in conjunction with my HDHomerun Prime, and I'm able to get all channels including HBO. I also installed up a dedicated drive for recordings and gave the VM direct access to it.

At first I had some performance issues: mostly live TV would stutter quite a bit. I upgraded the ethernet drivers for the on-board Realtek ethernet adapter I was using within Server 2012 and that helped a lot, but the stuttering problem remained. Another thread suggested getting a dedicated Intel ethernet card instead of using onboard, so I then tried that, which once again improved performance a bit, but I'm still having some issues. Oddly, watching live TV seems just fine now, but watching recorded TV becomes a problem after about 10-15 minutes. It usually works just fine for a little while, then it begins to stutter.

Any suggestions? Anyone else running a similar virtualized setup?

jec6613

Posts: 72
Joined: Thu Oct 30, 2014 8:45 pm
Location:

HTPC Specs: Show details

#2

Post by jec6613 » Mon Apr 13, 2015 8:35 pm

For streaming, you should configure the guest OS to punch through directly to its own physical NIC, and keep all other traffic on other NICs. Also, ensure that you fat provision, not thin provision, the VHD.

RyC

Posts: 724
Joined: Tue Aug 21, 2012 10:21 pm
Location:

HTPC Specs: Show details

#3

Post by RyC » Mon Apr 13, 2015 10:53 pm

I'm not sure if Hyper-V can passthrough PCIe devices like ESXi can, but that is the best option if possible. I'm doing that on ESXi and have no streaming problems.

Venom51

Posts: 568
Joined: Sun Jun 12, 2011 7:12 pm
Location: Cumming,GA

HTPC Specs: Show details

#4

Post by Venom51 » Tue Apr 14, 2015 8:46 pm

2012 R2 supports Enhanced Session Mode will pass though most devices. It also requires an 8.1 or 2012 R2 guest OS to utilize the features.

RyC

Posts: 724
Joined: Tue Aug 21, 2012 10:21 pm
Location:

HTPC Specs: Show details

#5

Post by RyC » Tue Apr 14, 2015 10:30 pm

I looked up enhanced session mode and it doesn't seem to serve the same purpose as PCI passthrough on ESXi. It seems like it's more for redirecting local resources on a remote connecting computer to the VM.

BlueScreenOfTOM

Posts: 15
Joined: Fri Apr 10, 2015 4:55 am
Location:

HTPC Specs: Show details

#6

Post by BlueScreenOfTOM » Wed Apr 15, 2015 2:36 am

Thanks for the responses folks.
jec6613 wrote:For streaming, you should configure the guest OS to punch through directly to its own physical NIC, and keep all other traffic on other NICs. Also, ensure that you fat provision, not thin provision, the VHD.
I admit I haven't tried giving the VM it's own NIC yet. I will try this tomorrow and get back to you. As far as the hard disk, I'm not using a VHD, the VM has it's own dedicated drive.
RyC wrote:I'm not sure if Hyper-V can passthrough PCIe devices like ESXi can, but that is the best option if possible
I don't believe this is possible with Hyper-V.
Venom51 wrote:2012 R2 supports Enhanced Session Mode will pass though most devices. It also requires an 8.1 or 2012 R2 guest OS to utilize the features.
This would be a last-resort since I'd have to basically start from scratch and install 8.1 instead of 7 Ultimate. I primarily chose 7 over 8.1 so that I could use non-360 extenders if I felt the need, but I'm thinking that'll probably never happen, so not ruling the 8.1 option out.


Again, my biggest source of confusion is this: I can stream live TV through WMC to my 360s just fine. I can be watching 3 different live HD channels on 3 TVs simultaneously with no issues at all. But if I try to watch recorded content, it stutters. It doesn't make sense to me.

BlueScreenOfTOM

Posts: 15
Joined: Fri Apr 10, 2015 4:55 am
Location:

HTPC Specs: Show details

#7

Post by BlueScreenOfTOM » Thu Apr 16, 2015 12:51 am

Ok, I tried giving the WMC VM it's own NIC. No dice, same issue.

I also stumbled across this thread from a few months back. This dude seems to be having the same issue. Too bad he gave up and went with ESX. I'm not quitting yet :D

BlueScreenOfTOM

Posts: 15
Joined: Fri Apr 10, 2015 4:55 am
Location:

HTPC Specs: Show details

#8

Post by BlueScreenOfTOM » Thu Apr 16, 2015 2:13 am

Ok, I did a couple things and recorded TV playback seems to be a lot better. I'm not sure if it was one of these things or a combination so I'll just list them all.
  • Turned off indexing on the recordings drive
  • Added an exception in the Security Essentials for the recordings drive
  • Added an exception for .wtv files in Security Essentials
  • Turned off the Page file
I'm not sure if it is 100% fixed yet. I'll report back.

BlueScreenOfTOM

Posts: 15
Joined: Fri Apr 10, 2015 4:55 am
Location:

HTPC Specs: Show details

#9

Post by BlueScreenOfTOM » Sat Apr 18, 2015 4:02 am

It's only been two days, but I've watched a ton of recorded shows and the stuttering problem seems to be gone. Not sure specifically what it was, but for all you future people out there looking to stand up Media Center in Hyper-V, I recommend following these steps. Certainly cleared up my issues!

CBO

Posts: 63
Joined: Tue Oct 09, 2012 11:40 pm
Location:

HTPC Specs: Show details

#10

Post by CBO » Thu May 21, 2015 12:03 pm

Can you detail your Hyper-v setup a little more in terms of hardware used and what if anything else you are running on the host? How much of the host gets taxed during max usage of the WMC VM? I'm thinking of doing the same thing. I would like to guage if the Hyper-v setup Im rolling will has enough horsepower for this and a few other VM's.

BlueScreenOfTOM

Posts: 15
Joined: Fri Apr 10, 2015 4:55 am
Location:

HTPC Specs: Show details

#11

Post by BlueScreenOfTOM » Sat May 23, 2015 4:16 pm

Yes. My Hyper-V box is basically a Dell XPS 8500 machine I got a few years ago. Core i7-3770 with 24GB RAM. I'm running Windows Server 2012 R2 Datacenter as the host OS. IIRC, Server 2012 R2 Standard should work fine too, and even Windows 8.1 supports Hyper-V so you might be able to use that as well. For the WMC VM, I'm using Windows 7 x64 Ultimate with 4GB RAM and 4 CPU cores.

The keys to getting WMC working well under Hyper-V seem to be the following:
  • Use a pass-thru disk and not a VHD/VHDX container to store your recordings.
  • Purchase a server-grade NIC. This also seems to be a requirement. The built-in Realtek gigabit on the XPS Motherboard blows and is unusable for this task. I ended up with an Intel Pro 1000 NIC, which unfortunately is PCI-E 4X, which in my case means I couldn't have a video card installed because the NIC needed this slot, so I have to use the on-board video. This works fine for me and actually knocks about 20w off my idle power usage, but if you plan on having a GPU in there, you'll need to go another route. Check eBay for used server NICs. I got mine for $20.
  • Create a VLAN with only your WMC instance connected, and give that exclusive access to a NIC port. I read this somewhere, and honestly haven't tried not doing it this way, but it works for me. The Pro 1000 NIC I bought has two ports, plus I have the on-board Realtek so I have a total of 3 NICs connected to the machine, so I'm not hurting for ports.
  • Turn off everything you can in the WMC VM. See my posts above about this.
So far it seems to be working pretty well. I imagine a better motherboard would probably yield better results. Next time around I'll do that, assuming of course WMC survives that long. I'm hoping for at least another 5 years out of it before they cut off the guide data.

poohbah

Posts: 4
Joined: Sun Jun 03, 2012 4:43 pm
Location:

HTPC Specs: Show details

#12

Post by poohbah » Mon Jul 06, 2015 3:43 am

It seems easier to virtualize the server on top of Win8. This is what I did with win8/WHS2011 and it works great. Just install Win8 with media center, enable hyper-V, and create a virtual server. Use pass through disks for the server. NO NIC issues and no tuner issues.

BlueScreenOfTOM

Posts: 15
Joined: Fri Apr 10, 2015 4:55 am
Location:

HTPC Specs: Show details

#13

Post by BlueScreenOfTOM » Thu Dec 31, 2015 2:34 am

Just to close the loop on this (so as to not give anyone false hope), I gave up on WMC on Hyper-V and went back to a dedicated machine for WMC. It seemed like it was one issue after another; I'd 'fix' one problem and it would just cause another.

As a post-mortem, I believe most of the issues I was experiencing were caused by the Hyper-V virtual switch architecture. I read somewhere that you can get around this and get direct access to a hardware ethernet adapter in Hyper-V using a relatively new technology called SR-IOV, but currently it looks as though only server-grade hardware supports SR-IOV which places it out of my price range, so I wasn't able to tinker with that.

So if I can leave you all with some parting advice: if you value your time and sanity, instead of trying to get WMC running on Hyper-V, spend $75 on some cheap 2009-ish hardware from Craigslist and install Win7 and WMC on there instead.

tocsin

Posts: 17
Joined: Wed Apr 22, 2015 10:17 am
Location:

HTPC Specs: Show details

#14

Post by tocsin » Tue Jan 12, 2016 6:39 pm

Please see posts #22 and following on

http://www.thegreenbutton.tv/forums/vie ... 54#p100554

as there is some hope of running WMC in a Hyper-V VM :)

inane69

Posts: 2
Joined: Thu Jan 03, 2013 8:44 pm
Location:

HTPC Specs: Show details

#15

Post by inane69 » Sat Jan 23, 2016 9:33 pm

tocsin wrote:Please see posts #22 and following on

http://www.thegreenbutton.tv/forums/vie ... 54#p100554

as there is some hope of running WMC in a Hyper-V VM :)
I've been considering rebuilding my WMC as a VM as using my 360 as an extender. Looking at what you did in the other thread, was the workaround to choppy playback to transcode recordings? I'd like to preserve native playback of live and recorded TV via the 360. Especially for watching sports in a tape delay fashion.

tocsin

Posts: 17
Joined: Wed Apr 22, 2015 10:17 am
Location:

HTPC Specs: Show details

#16

Post by tocsin » Mon Jan 25, 2016 4:34 pm

inane69 wrote: I've been considering rebuilding my WMC as a VM as using my 360 as an extender. Looking at what you did in the other thread, was the workaround to choppy playback to transcode recordings? I'd like to preserve native playback of live and recorded TV via the 360. Especially for watching sports in a tape delay fashion.
Yes, I've avoided native playback (I keep the original .wtv files as an archive but don't 'play' them). All the recordings are edited using VideoReDo and then converted to .MP4 format for normal use - this is partly because that was the format used when I edited from DVD/ HD recorder before moving to WMC. So what I have is only a partial solution - I've not noticed any playback issues of the .wtv files within VideoReDo though.

DavidFullerton

Posts: 4
Joined: Mon Jun 27, 2016 8:49 pm
Location:

HTPC Specs: Show details

#17

Post by DavidFullerton » Tue Jun 28, 2016 6:18 am

[Sorry to follow-up later on this and ask, but I am definitely curious about how this applies to my situation ...]

Okay, I have a very old WMC system; I'm a student, so I keep my hardware forever -- you wouldn't believe how old but it works pretty good for WMC.

Anyway, I got newer hardware that will be incredibly so much faster, and I plan to set it up for ESXi and run VMs there. Nothing much just mainly I want to get a Win7 VM with WMC in it. Multiple people say it works, so I am not worried about that.

Here is what I am curious about. Let's say, I get it running perfect and LOCK DOWN the VM hardware to its own initial settings for the VM. And, since the VM is virtualized, the actual WMC and PlayReady won't know / understand that it is laying on top of a VM. Right? Knowing that, I don't have to worry about the UNDERLYING HARDWARE ... right?

Here's why. Say, two years down the road, I decide to get faster and better hardware again, then I can just move the WMC in the VM and it won't be wiser ... right? Nothing will be broken, is that correct? And, has anyone tried this?

Because, right now, I'm pissed because my older hardware is going ON THE FRITZ and crashing alot, so I can't move my Copy-Once flagged movies (got a lot of good Zombie movies, my favorite: "28 Days Later", "28 Weeks Later", etc.) to my newer box. I will lose everything, because I won't be able to satisfy Playready. That is fine because I will just start over and VIRTUALIZE WMC then not have that issue in the future.

Is that right? If so, please, tell me your experiences positive or negative.

Also, I wished that I would have known about TGB in the past, because I was SLAVING AWAY all alone trying to figure this CRAP OUT and getting so frustrated at times. Microsoft sure did not make it easy with PlayReady and WMC setup and other problems to ever really truly make WMC a good HTPC product.

Thanks for anyone / everyone's time ...

BlueScreenOfTOM

Posts: 15
Joined: Fri Apr 10, 2015 4:55 am
Location:

HTPC Specs: Show details

#18

Post by BlueScreenOfTOM » Mon May 14, 2018 1:11 pm

Time to revisit this classic thread with some updates!

I recently upgraded my old "server" based on the Dell XPS 8500 I had listed above to a much more powerful HP Z820 workstation. I installed Server 2016 and I'd read that they've further improved the hardware passthrough features on top of SR-IOV support. Unfortunately it appears that the Z820 hardware doesn't fully support PCI-E hardware passthrough, so that's kind of disappointing. Still, I've been having some issues lately with my non-virtualized WMC setup (mainly slow guide browsing since upgrading to EPG123) and I still had the VM I'd configured for WMC laying around, so I figured I'd fire it up on the new hardware and see what happened.

I configured the VM in a similar way as I'd had it set up last time -- it had its own pass-through drive for storing recordings, and a dedicated PCI-E Intel network adapter. After booting, the VM had about 100 updates to run, and I had to re-run the WMC setup as I've switched TV providers since I last used it. It complained that it couldn't update PlayReady, and I was able to solve that issue using some suggestions I found on another thread here. The VM is pre-EPG123, and to my surprise it was able to go and grab guide data from Microsoft without any trouble. I took one of my Xbox 360 extenders and pointed it to the VM and it connected just fine. I flipped channels and everything seemed to be working well. I slowly started flipping my other extenders to point to the VM, and so far so good, no issues yet.

Last time I did this, it took a bit for some of the issues to surface, so I hesitate to say things are working perfectly. But it's looking good so far. I'm not sure if the improvements are due to the better hardware, Server 2016, or both. Either way, I'm optimistic and hoping that I'll be able to decommission my dedicated WMC hardware.

BlueScreenOfTOM

Posts: 15
Joined: Fri Apr 10, 2015 4:55 am
Location:

HTPC Specs: Show details

#19

Post by BlueScreenOfTOM » Tue May 15, 2018 2:31 pm

I hit some hiccups but I think we have a happy ending...

So I've watched a good bit more live TV without any issues, so far so good, everything looks great. I sat down last night to watch some recorded TV and that's when the trouble started. I hit play on a recording and things seemed to freeze. Several seconds later, I got a few seconds of playback, followed by more freeze. Not good. So I open up the console for the WMC VM and I check out resource monitor. I noticed that, for some reason, the recordings drive has super high response times, like over 3 seconds. Not normal at all. Note that this is the same drive that I was using for recordings the last time I tried this back in 2015. It's basically been gathering dust since then. But all signs inside the VM point to drive issues with my recordings drive.

So I jump out of the VM onto the hypervisor and I run CrystalDiskInfo. Boom - a big red "BAD" report for the recordings drive. Thousands of reallocated sectors. I've never actually seen CrystalDiskInfo report a drive as "BAD", so this is a first.

Well shit, I don't have another drive lying around. I do, however, have a bunch of space on some other drives in the machine. So I fat-provisioned a 500GB vhdx on one of my other drives and pointed the WMC VM to that. I tried recording a random episode of The X Files to it and playing it back, seems to be working okay so far. But I'm in uncharted territory here - using a virtual disk for my recordings and the Hyper-v Virtual Adapter for networking... let's see how it goes.

cwinfield

Posts: 575
Joined: Tue Feb 12, 2013 1:14 am
Location: Monroe, NC

HTPC Specs: Show details

#20

Post by cwinfield » Tue May 15, 2018 2:42 pm

is gpu virtualization included in server 2016 hyper-v, it isn't included afaik in windows 8.1 pro. Do you use live TV in the hyper-v console at all? I set my VM specifically for extenders so it wasn't a show stopper for me but if I tried opening I get the does not meet system requirements message.

Post Reply