Headless uTorrent Linux server in OpenVZ
Yes, I know, another Linux post. What can I say, this is what I do these days.
I’ve been running a Windows server in a kvm VM just to be able to run uTorrent. This was overkill, had a crazy amount of overhead, and was unstable (downloading to a share on my Samba server). Today I decided to attempt a more efficient solution: uTorrent in Wine. (Yes, there are other BitTorrent clients, and even… NATIVE Linux clients, but I’ve found none of them match the speed of uTorrent for my connection except for kTorrent. However, I don’t have an Android and/or iPhone app to remote control kTorrent.) Wine is a supported platform, according to the uTorrent website, however I wanted to run it on a headless OpenVZ container, and not on a standard desktop Linux distro. Should still be pretty simple, but knowing me, I might forget something next time I try and set this up, so I’ll document it here.
- Create a fresh VZ container. I used the Proxmox Debian 6.0 (squeeze) – standard i386 template.
- Edit /etc/apt/sources.list to point to a fast mirror in Canada (iweb!)
deb http://debian.mirror.iweb.ca/debian squeeze main contrib non-free
deb http://debian.mirror.iweb.ca/debian-security squeeze/updates main contrib non-free - run an apt-get update && apt-get upgrade
- apt-get install wine sudo xterm openbox tightvncserver
- adduser matt
- add google repo: http://www.google.com/linuxrepositories/apt.html
- install Google Chrome
- wget http://download.utorrent.com/2.0.2/utorrent.exe
- From another PC: ssh -Y matt@openvz-container
- wine winecfg
- run vncserver and set a password.
- run wine utorrent.exe
- Enable Web UI
Next steps:
- Set up Dropbox for easy adding of torrents: http://wiki.dropbox.com/TipsAndTricks/TextBasedLinuxInstall
- Make uTorrent and VNC server run on container startup*
- Create a VZ mount script so that torrents download outside of /vz area.
* For this I used a cool script obtained from http://www.abdevelopment.ca/blog/start-vnc-server-ubuntu-boot :
- Modify your
~/.vnc/xstartup
to start the programs you want (gnome-session, lxde-session, utorrent, etc.) - Save the following script as /etc/init.d/vncserver. Change
export USER="mythtv"
to the user you want to run the VNC session for.
#!/bin/sh -e ### BEGIN INIT INFO # Provides: vncserver # Required-Start: networking # Default-Start: 3 4 5 # Default-Stop: 0 6 ### END INIT INFO PATH="$PATH:/usr/X11R6/bin/" # The Username:Group that will run VNC export USER="mythtv" #${RUNAS} # The display that VNC will use DISPLAY="1" # Color depth (between 8 and 32) DEPTH="16" # The Desktop geometry to use. #GEOMETRY="x" #GEOMETRY="800x600" GEOMETRY="1024x768" #GEOMETRY="1280x1024" # The name that the VNC Desktop will have. NAME="my-vnc-server" OPTIONS="-name ${NAME} -depth ${DEPTH} -geometry ${GEOMETRY} :${DISPLAY}" . /lib/lsb/init-functions case "$1" in start) log_action_begin_msg "Starting vncserver for user '${USER}' on localhost:${DISPLAY}" su ${USER} -c "/usr/bin/vncserver ${OPTIONS}" ;; stop) log_action_begin_msg "Stopping vncserver for user '${USER}' on localhost:${DISPLAY}" su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}" ;; restart) $0 stop $0 start ;; esac exit 0 |
For more info, see the source link.
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10_6_3; en-US) AppleWebKit/533.4 (KHTML, like Gecko) Chrome/5.0.375.70 Safari/533.4
Instead of uTorrent, take a look at http://deluge-torrent.org/ – it’s pretty awesome.
Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.6; en-US; rv:1.9.2.12) Gecko/20101026 Firefox/3.6.12
Thanks, finally did switch to Deluge. Much better.