Search This Blog

Thursday, April 7, 2011

Our home server and setting up really nice remote management

Our server at home is a Windows 7 Ultimate machine - a custom build in a huge Lian Li black box with space for 14 HDs, currently 9 occupied.  It's nothing fancy - no RAID, No FlexRaid, etc etc, just a bunch of drives loaded with media.  I've experimented with all the rest, from NAS, to Drobos, to UnRaid etc, and I find them all too slow and laborious, and ALL of them absolutely suck when things fall over with very large libraries.  So I figures 9 separate drives - I just use SMART monitoring and if one looks like failing I replace it.  So far this has worked well for a few years.  If I lose one - well, it's 10% of the collection or so, that I can live with.  If someone steals the whole box, I am screwed but I have an alarm and life is too short to worry! 

Really crucial stuff - photos and my music collection, are backed up to my work server and synchronised nightly.  And using just every day hard drives without RAID or NAS access means things are very fast with 120 mb/sec+ write speeds instead of the puny figures you get with the other systems (max of about 60 mb/s in practise I have found).

This machine is also used as a desktop by my wife for maybe 10 hours a week, but it's most important function is to act as a home server for our:
Videos
Music
eBooks
Photos

Serving most of this stuff to 'heads' around the house (Squeezeboxes and XBMC machines), as well as providing some internet services (FTP, Calibre eBook library etc).

I run a Windows 7 machine because I am very familiar with Windows, because there's always a piece of software to do just about anything you could want on Windows even if it isn't really 'Windowsy' (for example, even though it's a Windows machine, it's easy to use the superior unix originated NFS file serving serving rather than crappy and slow SMB).... and because it has a nice GUI for my wife's desktop use.  I use a LOT of media apps on this machine, such as Ember Media Manager (Revisited), TVRename, MP3Tag, Foobar, Calibre, etc.  And I tend to do some of this media management from work since I am the boss, and I can, and I have young kids so stuff all time to my self when I am at home.

For a long time now I have been doing all thus by remote desk-topping into the server and then running the apps - this is pretty good, but it's got some issues - one, it's kind of heavy, as the the whole desktop has to be transported over the network, so while it's pretty snappy (RDP v7 is a great, efficient protocol, WAY better than, say, VNC)....it could be yet better.  Also, when I remote desktop in to the machine (say from work), it logs my wife off if she happens to be using the machine at that moment (as Windows 7 as delivered will only let one user stay have an active session at a time), and there's no easy way for me to (remotely) tell for sure if she is or isn't using the machine at a particular moment...I have to ring her, or maybe check her Skype icon to see if she's active. 

What I really want is PROPER server access - as many connections as I want, and the ability to just run an app remotely rather than the whole desktop.  Just like back in the uni lab using an xterm to access the Sun servers.  And all of this stuff is actually built into Win7, it's just kind of hidden and not enabled by default.  Personally I find it kind of ridiculous that we're all still using thick clients - I would much rather have one massive server - a single place to update and administrate - running everything and just use thin clients to connect back to this server.  But instead I am currently repsonsible for administering (not counting  friends and family) - some 9 machines between my work and home.

So here's how to do set this up on Windows 7...it's a two step, moderately tricky process, but the results are definitely worth it...

Enabling concurrent remote sessions in Windows 7 SP1:
I used the script from this page.  I used the 'install' option to allow multiple user sessions (that is, a single session per user running concurrently).  I did not do an 'install multi' to allow each user to have multiple sessions.  It's not needed for what I want to do and can make it tricky to connect back to the main 'console' session - i.e. the primary user logged into the Win 7 desktop at the terminal.

Setting up RemoteApps (rather than full remote desktop):
I followed this guide - and in particular the kind of summary comment that I quote here as the use of the double || symbol seems essential:

Let me recap with two simple steps, 
1) make
HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Terminal Server\TSAppAllowList\Applications, now on
on Applications create a key named "AppName", and within it, a String key named "Path" with the full path to the application. That's all that's required on the server.

2), on the client rdp file:
remoteapplicationmode:i:1
remoteapplicationprogram:s:||AppName
RemoteApplicationCmdLine:s:Any_Parameter_To_Pass




All of this allows you to set up RDP files that run apps, not the whole desktop - which basically means you can just click on the RDP file and the app on the server just runs on the client machine as if it is a local app.  It's a very comfortable way of working (and basically turns your Win7 Server into a Win Server2008 machine...). You get access to the server drives etc, it's exactly as it you were working right on the server machine.  Sweet!  I can also just log into a whole remote desktop as normaly, but now as a different user without bothering my wife if she happens to be using the machine. AND, I can take over the console session easily as well if I want to.


Fun times.