1. VirtualBox MediaServer
This page was put together 'over time' so 'some assembly may be required'. Typically, I keep notes for my own use. Then I'll rearrange them a bit, add some random rambling and throw it on the net. If you have a decent knowledge of your OS, you might be better of starting with the server and client pages...
First a warning for those interested in running virtual machines:
Running HTPC's or media servers in a virtual machine is asking for problems.
That's mostly due to lack of video support, or some weird and unpredictable behaviour of some applications. You probably want to skip this section and immediately go for the real thing, that is: get yourself a decent PC and turn it into a dedicated server.
well, you have been warned. Read on...
(Well, okay, a box to run VirtualBox on :-))
After installing and setting up your OS it's time to install all other software... Try and test one application at a time, don't go wild!
If (when!) I fall in some specific trap OS related I'll add some notes here.
2009 Windows XP SP3
Ah, my favorite OS to date. Works well, though it's nearing end-of-life. It isn't free and you probably can't even buy it anymore. But it does work on not-the-latest hardware, with some effort :-)
Alas, Windows XP is almost dead (no more patches / updates from April 2014) and you can't buy it anymore, so it's time to look around for something newer.
I cannot say anything posoitive about Vista, just skip it. It's like the 32 bits version of Windows ME.
You may consider Windows 7 (if you can still obtain a copy) but be aware that you might not be able to run it on onder hardware due to lack of drivers. And updates will stop in January 2020.
Then there's the beast called Windows 8. The Metro interface is horrible, and there are some other limitations, but unless you go for Linus it just might be your only chance... I'm going to try to upgrade my home server (currently running XP) to Windows 8, and see how things go from there.
As I started out with Windows XP, I'll focus on any major differences and add them. I don't expect too many, but still...
Take Windows 8, remove Privacy and add enforced updates... that's Windows 10. I'm especially worried about Windows 10 screwing up older systems by involuntary driver replacements. Microsoft should at least allow us to block driver updates, please! Anyway, if you want to run Windows it's the only game left in town...
Unfortunately, my experience with running Windows 10 Home on a home server has been... interesting...
1. Windows 10 by default did not differentiate between active and inactive windows in regards to the tile bar of a window. You migt see a thin line of a different colour surrounding the bar, but that's about it.
3. To have easier access to user accounts create a shortcut to:
netplwiz4. Some options are easier to access from the Windows 10 settings, some via the old control panel. A direct link to Windows 10 settings:
ms-settings:5. Same thing for the classic control panel:
%windir%\system32\control.exe6. This is also where you find the old time favorites like naming your PC, set visual effects, virtual memory, environment variables and system protection.
7. Modify environment variables if you like all temp files together, and want to include some folder containing batch files or utilities whenever you go fancy and use the command line...
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp9. Allow ICMP PING
Note: allowing SMB1 will reduce security of your server, as SMB is no longer considered secure!11. Some options of Windows have been removed / hidden for the average user. Bring them back using WinAero tweaker. I immediately change the following:
Don't ask. I'm pretty much a Windows guy, but I may be forced to go the Linux way... sigh... Will be continued once I'm either comfortable enough, or can no longer affort Windows. I would have switched to Linux a long time ago, but some of the apps I run simply don't work on Linux, and / or I have not found any alternatives yet. Still, things may improve down the line.
Update. I've decided to put some more time in Linux, as I'm fed up with Windows 10's power management. I'll return my homeserver to Windows 7, and replace it and 2019 with Linux. Good riddance, Windows 10.
Only install a codec pack if you need one.
I've been using the CCCP for a while, the Combined Community Codec Pack. You'll find it here: http://www.cccp-project.net. There are other packs, and the last release of for example TVersity seems to include one itself, though I haven't tried it.
Make sure your codec pack works well on your OS and hardware. I'm still using CCCP, even on my 64 bit Windows 7 box, but there are many horror stories around.
Now you've collected hundreds and hundreds of files, but how do you organize them? That depends...
This may seem to be entirely a matter of taste, but there are some things to consider. Some software may offer document management features, some other software may force you to name and tag each and every file, whilst other software simply uses the folder structure to present all files to the end user.
My suggestion is to try and organise your folder / file structure as systematically as possible. Assume your server has two drives, C and D. Drive C would contain the OS and all software, and D would contain all media files. The next step would be to organise your files something like this:
D:\mediaThe above works great if you use a single harddisk, but once you end up with a bunch of harddisks, you might adopt something like this:
D:\temp - generic temporary folder... or whatever piques your fancy...
Next when you set up software like TVersity, you can assign specific names / folders / paths / tags / whatever to each folder. And it would be a good idea to keep 'logical' names as close to the real paths, so accessing material through a logical path would be pretty much the same as accessing it through a file share.
Note that some software does not support a dedicated temp folder, for example TVersity. If you use an SSD or USB drive as your boot device, it may be smart to install TVersity NOT in its default place (under C:\Program Files) but on another drive (D:\TVersity or something similar).
Obviously you may want to consider more than one user, and you may not want your average user to delete or rename your files in which case make sure you give that specific user only Read Only rights.
By organizing stuff from the start, you'll have an easier time finding things back, no matter how you access them. For example, here are some devices browsing my mediaserver, either through TVersity UPNP or Windows shares.
A PC (or HTPC) accessing Windows shares:
Some file formats allow you to enter meta data, for exmaple the MP3 file format supports all sorts of tags. Some player software can use the folder structure, but sometimes it can not so you'll be forced to check all tags in your files...
MP3's are the prime candidates for such a treatment. If your folder / file structure is consistent, you could use a program such as MP3Tag to replace the existing tags in your MP3 files.
Some AVI and MKV files seem to support their own flavour of tags, sometimes accessible through file properties, but if not I have no idea how to manipulate them.
If you run multiple services on your server, such as TVersity, Servioo, SqueezeServer etc. all these programs allow you to specify a name, under which they can be found on your network. Use sensible names. Here's what I might use on a server on 192.168.0.72:
6. Stuff that won't run as a service
Many applications won't run as a 'service'. Blame it on Windows, or blame it on the programmer, but fact is a fact. If you want to run some programs, you have to be logged in as administrator. This obviously is a bit of a security risk, especially if you use your server for other purposes as well.
Unfortunately, there's no real and 'proper' solution. All you can do on Windows XP is allow fast user switching, then, on startup, automatically login as a specific user, execute what you need, then return to the login-screen, whilst everything you started keeps running in the background. Who said this was a perfect world?
Anything that would run as a service (and would make sense to run as a service) I set up that way. Everything else I start using a batch file.
Here's what I did:
tskill squeezeslaveIt's possible to fancy up things. By inserting some delays the actual boot time decreases (ie. launching programs do not compete for resources). I also rearranged all windows to have a better quick overview of what's running and what not. And sometimes 'start' works fine, but not always and then I have to fall back on psexec.
Fooling around a bit with cmdow and nircmd (and I wouldn't bother too much with the 'wait' statements, they were just minor improvements, and don't really matter when using Wake On Lan or SSD's...) Here's an example startup batch file:
cmdow @ /TOPThe two interesting programs here are mircmd and cmdow.
Nircmd is a kind of all-in-one toolbox, which was many different functions. Including a very simple 'delay' function (which doesn't eat up timeslices).
is often blacklisted as a 'hacker tool', just like netcat.
Cmdow in itself is simply a little command line tool that allows you to
do all sorts of things to Windows. Including moving or hiding them. It
has been abused by malware programmers to hide windows from the user, hence
6.2 Windows 7
Of course, since then I've learned a bit :-)
My current startup file looks like this:
rem *** immediately return to user login
Power saving is an issue. First, make sure you won't waste too much energy by picking the right hardware...
the next sections if power management is not your thing, and you've
got lots of money to burn :-)
You basically want to start the server only when it needs to process or deliver data, otherwise it should be sleeping as much as possible to save energy. Turns out that this isn't always easy... Powermanagement often simply doesn't work, isn't compatible with all hardware, or does other funny things. There's no clear rule, so you're pretty much on your own.
All I can do is talk about some of my experiences, and perhaps they may help you find a solution.
On my test-setup, using a Core i3, 4 GB Ram, on-board audio and graphics, an old power supply and 3 harddrives, I got the following power consumption figures:
Here's the choice: either implement WOL with magic packets, and accept thatyou may have to 'wake up' your server (though it may wake up accidentally), or leave your server up and running all the time. I've calculated my own usage, and I would save 50 euro per year in energy costs by using WOL. Thus, WOL it is.
Update. Hibernate and standby power consumption was primarily caused by an (inefficient) power supply.
WIth other, slightly newer but less powerfull hardware using Windows 10:
once you go into sleep or standby, all your hardware except network card
and memory is off. Or is supposed to be off. I've seen a few machines that
kept their fans spinning. Sometimes USB ports are powered, sometimes not.
Sometimes on-board network cards work, but a PCI or PCIe network card may
not recognize a WOL.
Hibernation, deep sleep, standby
In hibernation your machine saves all memory to the harddisk, then shuts down.
Older machines could still allow a WOL to wake up as they might keep their network cards / chips under power, but newer machines often DO NOT support WOL in combination with hibernation as they shut down all the hardware. Not all machines like or recover well from hibernation, you have to test this for yourself. Advantage: power outages will not bother your PC (it's off anyway) and power consumption will be the lowest. Disadvantage: slow restart, more wear and tear on your harddrives (well, marginally). Return from hibernation will spin up all your drives, even when not necessary.
Hibernation is considered a warm boot, as the OS does not reload but tries to restore the system.
There's some confusion about deep sleep and standby, as different manufacturers may use different terms. AFAIK: standby shuts down many parts, and deep sleep shuts down even more parts. Some machines may only support one or the other, some support both. If you can use both, you may have to resort to a kill-a-wat power meter to deduce which mode saves you more power.
In standby / sleep mode, your machine doesn't save all memory to harddisk, but instead keeps memory alive and under power, yet shuts down pretty much everything else (except for WOL related stuff, obviously).
well a machine handles a warm boot (from standby / sleep) varies. Some
machines may not re-enable their PCI(e) cards, some drivers may simply
fail after a warm boot, or applications might crash. You may lose drives
when using PCE(e) SATA or RAID controllers, and you may lose network cards
on older OS'es on a warm boot.
These settings depend on your preferences. After fooling around with them I settled for the following settings using Windows 10:
(The exact location / naming schedule depends on your version of Windows, but this should give you a clue where to look.)
Things may not work as expected, depending on your hardware and configuration! That out of the way, here's the issue:
What is WOL?
WOL, WakeOnLan, Wake On Lan... clear as any marketing slide ever... (Check out Don McMillan!)
Most network cards offer two options for wake up: wake up on either a 'magic packet', or wake up on any traffic.
By sending a special message to your server you can switch it on. This message is a so called 'magic packet'. If your server supports 'power saving' modes (stuff called S3, S4 etcetera) and your network card supports WOL you can wakeup your server whenever it's needed.
You could opt for waking up the server on any traffic, but for all practical purposes that means your server keeps waking up all the time. Thus never goes to sleep. If you have a configurable router (instead of the typical dumb switch) you might try that approach. For most people though it is not an option, because other systems in the network keep pestering your server with requests, thus waking it up all the time, even if those other systems don't need any actual data.
you are trying to wake up a server, you need the MAC address of the network
card. You can't use the IP address, because to use the IP address the machine
needs to be already running.
Enabling WOL on the server
(The exact location / naming schedule depends on your version of Windows, but this should give you a clue where to look.)
latest Windows 10 clean install enabled WOL by default. Interesting...
Getting the server's MAC address
C:\> ipconfig /all
Wake-up on the local network
On an iPad, install mWOL by Mocha, and enter the IP address and MAC address you've found. Hit the 'Wake up' button to wake up your machine.
On Android, install WOL by Ben Finnigan, enter the IP address and MAC address, etcetera.
When using mcwol:
Here's an example batch file which waits until a specific machine is awake:
ping 10.151.0.72 -n 1 -w 5000
ping 10.151.0.72 -n 1 -w 10
if errorlevel 1 goto loop
If you need a batch file that's a little more refined output wise, try this one: (it also seems to handle timeouts better, but better check out the Internet for proper wakeup scripts)
If you want to access data on the server from the Internet (because you're simply elsewhere) things can get tricky. If you're on ADSL with a fixed IP address, do this:
Wake-up from the Internet using a FritzBox
If you own a Fritzbox router, you're not allowed to forward to anything like x.x.x.255, but the Fritzbox offers another option:
Solution: disable or manually switch on / off (the rules for) those forwarded ports. You may have to manually enable / disable those rules, enable uPNP, or accept slightly slower speeds and less sources without those ports forwarded, however in most cases you won't have to do a thing, the NAT protocol in the router will take care of it.
leaves you with a funny setup: local users need to wake up the server,
whilst it wakes up automatically for a remote users accessing it
from the Internet.Yeah, the computer industry still has to think a bit
harder on this energy management / WOL stuff... (Why not implement WOL
as part of Windows as a kind of fall back scenario?)
What if it all doesn't work?
There are so many things that can go wrong...
most common ones:
Server wakes up then immediately shuts down
Server wakes up then shuts down after a preset time REGARDLESS of sleep settings
head to Google. Windows 8 and 10 have Micky Mouse features to avoid inadvertent
wakeups... so they shut down the machine if there's no user. Makes sense
on a laptop, doesn't make much sense on a home server. You probably have
to resort to registry edits, yet again.
Server doesn't recognize load
shuts down, even when busy. The catch is often it isn't busy enough.
Especially Windows XP suffered from this problem. I never found a solution..
Server doesn't go back to sleep... ever!
those things happen. I ran into a strange issue where my server went to
sleep fine if I kept the time out short (for example standby after 5 minutes
worked fine). Yet, when I set it up to go to sleep after 2 hours, it rarely
did... One of the installed applications must be doing a periodic scan
or something messing up the idle detection. No real solution, but read
up on short term standby, it simply wasn't working reliable. Still, I wanted
to save some energy! So to this end I cooked up this elaborate scheme,
which handles a multitude of problems... (Hey, I'm good! :-))
Old (XP) approach
C:\> %windir%\system32\rundll.exe powrprof.dll,SetSuspendStateNote: with hibernation enabled the machine will go into hibernation, not into standby. With standby enabled and hibernation disabled it will go into standby.
To shutdown the server at 03:00, I call a batch file containing the following:
taskkill /IM javaw.exe /F /TEither ServeToMe or ImageBank needed killing the Java engine (I forgot which one :-)) and the Serviio lines are no longer required since I uninstalled Serviio.
So, here's what happens:
C:\software\power_shortcuts\psshutdown.exe -d -t 0
If your server is somewhere where you do not have immediate and convenient access to it (attick, garage, broom closet etc.) then install a remote management tool like VNC. It allows you to remote control your server, and you definitely want that! There are many flavours of VNC. TightVNC seems to work well for many people.
installing VNC on the server, install it as a 'service' to keep it running,
no matter if you're logged in or not.
Windows XP / Windows 7 / Windows 8