Become a Site Supporter and Never see Ads again!

Author Topic: Headless Home Media Server with Ubuntu Server 10.04  (Read 26578 times)

0 Members and 1 Guest are viewing this topic.

Offline baustin

  • Trade Count: (4)
  • Needs to get out more...
  • *****
  • Posts: 2793
  • Gender: Male
Headless Home Media Server with Ubuntu Server 10.04
« on: August 28, 2011, 12:58:12 PM »
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 Installation

http://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 Installation

Ubunbtu Server is command line, so I installed a GUI:
http://www.youtube.com/watch?v=91E7rhnsyCw

sudo apt-get update
sudo apt-get upgrade
sudo apt-get install ubuntu-desktop
sudo reboot


Boot Directly to [user] and ROOT access

As 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 Management

System>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 Mounting

Format:
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 adjust
tune2fs -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 network

The 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 7

At 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-drive


Remote desktop connection to view your ubuntu desktop from windows

http://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 Line

Once 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 &
« Last Edit: September 07, 2011, 12:43:20 PM by baustin »

Offline baustin

  • Trade Count: (4)
  • Needs to get out more...
  • *****
  • Posts: 2793
  • Gender: Male
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #1 on: August 28, 2011, 01:23:24 PM »
If any of you Linux gurus out there have any suggestions, I'd love to hear them.


Offline rastasean

  • in paradise
  • Trade Count: (23)
  • Needs to get out more...
  • *****
  • Posts: 3699
  • Gender: Male
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #2 on: August 28, 2011, 02:28:41 PM »
I have a ubuntu server with 10.10 (which you will have after you update and then upgrade) with a couple IDE drives. Since I mostly use linux in my house, I use NFS and mount the drives from the server (jackknife) to my other machines. works very nice.

I would recommend installing torrentflux so you can have the ubuntu server use this application to download/upload torrents without it being on your main machine. Once the download of a particular torrent is done, you can copy to windows 7, play from ubuntu server directly, or copy to some media player.

http://en.wikipedia.org/wiki/TorrentFlux
http://sourceforge.net/projects/torrentflux/
This article is a little out of date but it will still contain some helpful information: http://ubuntuforums.org/showthread.php?t=268985


This is also what I would recommend...
have the ubuntu server run with the GUI for a little bit so you can see what linux looks like and how you interact with it but then change the boot startup to just be text based and use something like putty to ssh into the machine when you need to make changes.
Most linux distros you would edit the runlevel to tell it if you want cli or gui but ubuntu is different. These couple articles may help explain how to disable the gui when it boots up
http://www.cyberciti.biz/faq/prevent-xorg-from-starting-in-linux/
http://ubuntuforums.org/showthread.php?t=1607830
http://ubuntuforums.org/showthread.php?t=1769615&highlight=disable+GUI

here's putty for w7 machine: http://www.chiark.greenend.org.uk/~sgtatham/putty/

have fun!
Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than it’s worth.

Offline sparkey

  • Trade Count: (5)
  • Needs to get out more...
  • *****
  • Posts: 4055
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #3 on: August 28, 2011, 03:00:29 PM »
pegging the thread....
#Generalstrike for president in 2024

Offline baustin

  • Trade Count: (4)
  • Needs to get out more...
  • *****
  • Posts: 2793
  • Gender: Male
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #4 on: August 28, 2011, 04:09:24 PM »
any reasons as to why you would not run the GUI?

also, can you explain to me how to move the string as mentioned here?
Quote
There is an issue with the above step that can be found here.
The solution is at step 12: https://bugs.launchpad.net/ubuntu/+source/xrdp/+bug/321040

If somebody explain how to safely make this adjustment, I'd be super grateful!

Quote
I guest all of you have samba installed in the System (If no it can be any additional package that has own pam authorizatuion schema). I will show what is wrong on the example with samba.
When you install samba package the installer adds an authorization method string into /etc/pam.d/common-auth file, it looks like:

auth optional pam_smbpass.so migrate

From the outer hand file /etc/pam.d/sesman contains inctruction:

@include common-auth

So this way the samba authorization method take part in authorization and sesman crashes on it.
The solution is just move string [auth optional pam_smbpass.so migrate] from file /etc/pam.d/common-auth to file /etc/pam.d/samba rigth under string [@include common-auth] and all will be fine.

Offline Gordon

  • Trade Count: (22)
  • Needs to get out more...
  • *****
  • Posts: 11785
  • Gender: Male
    • my list
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #5 on: August 28, 2011, 04:37:36 PM »
Transfer speeds seem to be limited by my roommate's old router which apparently is not a gigabit router.

get a gigabit switch.  run a cable from the router to it.  then plug the server and windows machine into the switch.  that's what I did.  works great and I got a 5 port switch for $30 after rebate.  rebate came pretty fast as well.

http://www.newegg.com/Product/Product.aspx?Item=N82E16833122128
Microtech Gefell M20 or M21 > Nbob actives > Naiant PFA > Sound Devices MixPre-6 II @ 32/48

https://archive.org/details/fav-gordonlw

https://archive.org/details/teamdirtysouth

Offline sparkey

  • Trade Count: (5)
  • Needs to get out more...
  • *****
  • Posts: 4055
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #6 on: August 28, 2011, 06:01:56 PM »
My only suggestion would be to add hosts entries to each of the boxes so that you can resolve by name, rather than IP....



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

#Generalstrike for president in 2024

Offline rastasean

  • in paradise
  • Trade Count: (23)
  • Needs to get out more...
  • *****
  • Posts: 3699
  • Gender: Male
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #7 on: August 28, 2011, 06:12:13 PM »
If your ubuntu server cannot ping the w7 by name (and if your w7 cannot ping US by name) I would do what sparky says and add w7 and US in their hosts files.

I say no gui because it will take more RAM and anything you can do in GUI can be done in CLI.

A gigabit switch will increase the transfer speeds between the two systems no doubt about it since you're using SATA.
Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than it’s worth.

Offline baustin

  • Trade Count: (4)
  • Needs to get out more...
  • *****
  • Posts: 2793
  • Gender: Male
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #8 on: August 28, 2011, 10:01:24 PM »
thanks for the feedback so far!

the remote connection step works fine however it only allows 1, onetime remote log in. once the machine is rebooted, you can log back in (again, only once).

the problem is caused by a conflict between samba and xrdp

there is a solution (listed below) which requires moving an authorization string from one file to another (which is above my knowledge level)

The solution is just
-move string [auth optional pam_smbpass.so migrate]
-from file /etc/pam.d/common-auth to file /etc/pam.d/samba rigth under string [@include common-auth]


Remote desktop connection to view your ubuntu desktop from windows

http://www.liberiangeek.net/2010/08/update-connect-ubuntu-10-04-lucid-lynx-rdp-windows/

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 the above step that can be found here.
The solution is at step 12: https://bugs.launchpad.net/ubuntu/+source/xrdp/+bug/321040

If somebody explain how to safely make this adjustment, I'd be super grateful!

Quote
I guest all of you have samba installed in the System (If no it can be any additional package that has own pam authorizatuion schema). I will show what is wrong on the example with samba.
When you install samba package the installer adds an authorization method string into /etc/pam.d/common-auth file, it looks like:

auth optional pam_smbpass.so migrate

From the outer hand file /etc/pam.d/sesman contains inctruction:

@include common-auth

So this way the samba authorization method take part in authorization and sesman crashes on it.
The solution is just move string [auth optional pam_smbpass.so migrate] from file /etc/pam.d/common-auth to file /etc/pam.d/samba rigth under string [@include common-auth] and all will be fine.

Offline rastasean

  • in paradise
  • Trade Count: (23)
  • Needs to get out more...
  • *****
  • Posts: 3699
  • Gender: Male
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #9 on: August 28, 2011, 10:22:56 PM »
So this just tells you to edit the file and move some text around.

You can use a text editor from ubuntu and open up the /etc/pam.d/common-auth and /etc/pam.d/samba
to make the switch.

You can also do this with the terminal using a simple text editor like nano
Code: [Select]
nano /etc/pam.d/common-authand
Code: [Select]
/etc/pam.d/samba

I hope this will help you out.
Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than it’s worth.

Offline baustin

  • Trade Count: (4)
  • Needs to get out more...
  • *****
  • Posts: 2793
  • Gender: Male
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #10 on: August 29, 2011, 12:38:38 AM »
worked like a charm. thanks!

not that i need to be logging into the ubuntu computer regularly... i need it right now to transfer data from external drives and eventually control torrents.

So this just tells you to edit the file and move some text around.

You can use a text editor from ubuntu and open up the /etc/pam.d/common-auth and /etc/pam.d/samba
to make the switch.

I hope this will help you out.

Online Fatah Ruark (aka MIKE B)

  • Trade Count: (11)
  • Needs to get out more...
  • *****
  • Posts: 9945
  • Gender: Male
  • I dream in beige.
    • sloppy.art.ink
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #11 on: August 29, 2011, 10:37:31 AM »
Cool. I'm in the process of turning a Pogoplug / Seagate FreeAgent Dockstar into a Torrent server. The device cost $40 and you can install Linux on it.

I've got Linux installed and running (no GUI), and pretty sure I have rTorrent installed correctly.

Next I have to get ruTorrent running so I can have a graphical interface via my Win7 machine (through the browser). And finally I need to figure out how to share the files with my network (SAMBA) so I can transfer my download files to my computer and vise-versa.

I'll probably grab another Pogoplug in the near future to use as a media server. Depends on if I can get it to work with my PS3 and also a Sonos.

I'm doing this on the Dockstar which seems to be a bit more expensive now. I also just bought a Pogoplug to keep stock (at least for now). You can do the same thing with it. I'm keeping mine stock for now. I'm going to put the Pogoplug over at my brothers house to send backups to over the internet.

Basically what I want to do is have all of my media available to me wherever I go, and use the least amount of electricity as possible. Right now I have everything (streaming, torrenting, etc) running on an old computer that is on 24/7. It's a bit overkill for most of the things I do. My only issue I think I will have with the Pogoplug type devices is streaming video on my LAN since that needs a little more processing power.


Here is a good deal on the Pogoplug:

http://www.adorama.com/COCPOGOE02.html?utm_term=Other&utm_medium=Shopping%20Site&utm_campaign=Other&utm_source=gbase


Install Debian onto the Pogoplug:

http://jeff.doozan.com/debian/


Install rtorrent:

http://forums.rutorrent.org/index.php?PHPSESSID=588414659c5407c13e5f52fc46e42bb6&topic=256.0


SAMBA instructions (still haven't tried this):

http://www.liquidsilver.org/2010/07/expanding-your-pogoplug/


More Pogoplug related links:

http://hackaday.com/2009/08/21/openpogo-an-alternative-to-pogoplug-software/
||| MICS:  Beyer CK930 | DPA 4022 | DPA 4080 | Nevaton MCE400 | Sennheiser Ambeo Headset |||
||| PREAMPS: DPA d:vice | Naiant Tinybox | Naiant IPA |||
||| DECKS: Sound Devices MixPre6 | iPod Touch 32GB |||
|||Concert History || LMA Recordings || Live YouTube |||

Offline H₂O

  • Trade Count: (28)
  • Needs to get out more...
  • *****
  • Posts: 5745
  • Gender: Male
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #12 on: August 29, 2011, 11:16:44 AM »
If you ever connect it to a "head" or TV, you may want to try XBMC - a Kick but media player (that can be controlled through an iphone/ipad or andriod device).

You may want to consider setting up a uPNP server so you can stream the content without Samba, i.e. VLC, etc (heck XBMC may work as well)

Any reason you installed the "Server" edition?  I think the desktop edition is good enough for using as a media server and simplifies some of your steps.
« Last Edit: August 29, 2011, 11:18:35 AM by H²O »
Music can at the least least explain you and at the most expand you
LMA Recordings

List

Offline Lil Kim Jong-Il

  • Trade Count: (6)
  • Needs to get out more...
  • *****
  • Posts: 6498
  • large Marge sent me
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #13 on: August 29, 2011, 11:34:34 AM »
XBMC has a upnp server built into it. Also, you can run headless and use the XBMC web interface for many tasks.



 
The first rule of amateur neurosurgery club is .... I forget.

Offline rastasean

  • in paradise
  • Trade Count: (23)
  • Needs to get out more...
  • *****
  • Posts: 3699
  • Gender: Male
Re: Headless Home Media Server with Ubuntu Server 10.04
« Reply #14 on: August 29, 2011, 04:26:14 PM »
Any reason you installed the "Server" edition?  I think the desktop edition is good enough for using as a media server and simplifies some of your steps.

if he wants to run as headless, he doesn't need the GIU and it sounds like that's the plan so the CLI is very easily the best solution.

Advice is a form of nostalgia, dispensing it is a way of fishing the past from the disposal, wiping it off, painting over the ugly parts and recycling it for more than it’s worth.

 

RSS | Mobile
Page created in 0.088 seconds with 43 queries.
© 2002-2024 Taperssection.com
Powered by SMF