I finally built/configured a Linux based Headless Media Server that is up and running exactly how I had hoped. The goal was to build a machine that could serve audio and video files to my Windows 7 machine. This is not intended to be a RAID machine as most of the data stored here is already on external drives. I simply wanted to be able to access all of the music without swapping drives.
My girlfriend's mom was tossing an Intel Core 2 Quad with 3GB of RAM and a motherboard with 5 sata connections. I picked up a somewhat future proof case from Newegg and snagged 2 (I should have gotten more) Seagate Barracuda Green 2TB drives that were on sale. More drives will be added shortly. Transfer speeds seem to be limited by my roommate's old router which apparently is not a gigabit router. 1080p MKV from the Ubuntu box are playing flawlessly on the Win 7 machine as I type.
For those that might be nervous, this setup was super easy and very quick.
Ubuntu Server 10.04 Installationhttp://www.ubuntugeek.com/step-by-step-ubuntu-10-04-lucid-lynx-lamp-server-setup.html-This is for a LAMP server, there are a few things I did differently
-Partitioning:
--As I used a small IDE strictly for the OS and no RAID, I chose Guided, Entire disk w/ LVM
--I did not partition the data drives (I did that later)
--I did not encrypt the home directory
-Chose NO automatic security updates
-For Software I chose (Space Bar) Samba
Ubuntu Server 10.04 GUI InstallationUbunbtu Server is command line, so I installed a GUI:
http://www.youtube.com/watch?v=91E7rhnsyCwsudo apt-get update
sudo apt-get upgrade
sudo apt-get install ubuntu-desktop
sudo reboot
Boot Directly to [user] and ROOT accessAs this is a machine without a monitor, mouse or keyboard, I set the unit up to bypass the login screen. Once the machine has booted and you've logged into the desktop for the first time:
system>administration>login screen>log in as [your user name]
Also, for some of this stuff you'll need root access. ubuntu wants to keep newbs like me from mucking anything up, so you have to gain root access.
in the terminal:
$ sudo passwd root
For the most part, I made many changes with the GUI, so I logged out of my [user] account and logged back in as root.
Power ManagementSystem>preferences>Power Management
-Never put the computer to sleep
-spin down disks when possible
-When the power button is pressed: shutdown
ROOT: Manage the Data Drives - Formatting and MountingFormat:
system>administration>disk utility
-find the data drive and format to ext4
-TaperJ suggested this command to get the most space out of the drive
My data drive was labeled as sdb1, you may need to adjusttune2fs -c0 -i0 -m0 /dev/sdb1
Auto Mount the drive at system startup:
http://www.techsupportalert.com/content/ubuntu-tips-and-tricks.htm#Auto-Mount-Drives-at-System-Startup-I realized that my data drive was not mounting at startup
-in addition to the suggested permissions, i also selected: allow any user to mount, allow a user to mount/unmount, the owner of the device can mount (this is the step that actually started mounting my data drives on boot)
ROOT: sharing the drive over the networkThe samba protocol was added during installation, but you'll need a GUI.
Navigate to the software center, search for Samba and install the GUI.
Once the Samba GUI is installed
system>administration>samba
-click the plus button to add a new share
-browse to the directory (mine shows up as /media/sdb1)
-give a share name
-allow writable and visible
-allow access to everyone
you may also need to make samba start on boot, i think this is the command:
update-rc.d smbd defaults
also did this. may not have been necessary, but its working:
places>file system>media>sdb1
-right click>properties
-Permissions
--i set allow owner, group and others to create and delete files
--apply permissions to enclosed files
-Share
--share this folder
--allow others to create/delete files
--create share
Map the Network drive in Windows 7At this point, the computer should:
-boot directly to the desktop as [user] without a log in screen
-samba should be running with your data drive being shared
-the drive should be visible in windows
Map the network drive in Windows
http://windows.microsoft.com/en-US/windows7/Create-a-shortcut-to-map-a-network-driveRemote desktop connection to view your ubuntu desktop from windowshttp://www.liberiangeek.net/2010/08/update-connect-ubuntu-10-04-lucid-lynx-rdp-windows/in ubuntu terminal, to install xrdp (program to communicate with windows remote desktop):
-sudo apt-get install xrdp
in ubuntu terminal:
-type ifconfig to find your inet addr (the computer's LAN address)
in windows remote desktop
-type the above number into windows remote desktop
There is an issue with this step caused by a conflict between samba and xrdp. The Remote Login works, but only once until the system is reset.
You can read about the issue here. The solution is at Step 12: https://bugs.launchpad.net/ubuntu/+source/xrdp/+bug/321040
Solution
-Login as ROOT
-use the text editor in ubuntu to open up the /etc/pam.d/common-auth and /etc/pam.d/samba files
-cut the string [auth optional pam_smbpass.so migrate] from file /etc/pam.d/common-auth
-paste the string [auth optional pam_smbpass.so migrate] to file /etc/pam.d/samba right under string [@include common-auth]Boot from Command LineOnce you are done configuring your system, you may want set it to boot to the command line rather than the GUI.
Notes:
-This will simply disable the GUI,
NOT uninstall it
-You will still be able to start the GUI from the command line
-You can still use the Remote Desktop Connection listed above to Log In to the desktop from Windows (the Ubuntu box will remain on Command Line)
-From what I can tell, much like the GUI setup, you simply need to start the machine and all settings are in place (ie - no need to log in as [user])
To disable the GUI on boot:
-From the Command Line: sudo gedit /etc/default/grub (this will open the Ubuntu Boot Loader in the text editor with Root permission)
-Change the line
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" (mine simply said quiet) to
GRUB_CMDLINE_LINUX_DEFAULT="text"-Update Grub: sudo update-grub
To start the GUI from the command line:
startx &