![]() About a month ago, I won a FREE SEEDBOX from seedboxhosting.com via a twitter contest... (see my previous post) They provided me with a Ubuntu server, root access, 300 gig of hard drive and 5 gig for the os partition alone. All of this with 768 megs of ram, a decent cpu and 100 megabits of un-metered upload/download bandwidth to play with! So for a while I was like cool! free seedbox! (I had one before... ) but then, I needed to download faster... see, servers are optimized for massive data storage over a cluster of discs. Not for speed... so a single file will go at about 1 megabit at best through ftp... but, 10 files at a time, I can max the speed of my home connection (30 megabits) no problems! Now, I have some scripting / bash / powershell experience under my belt... The idea was to create a script (bash) that would get the file size of any given file, and split it into .rar files. I wanted to specify the number of rar files... because I don't get the speed to be equally distributed for all 10 transfer slots.. some will go at 1 megabit (1000 kbps... ) but others will be at 200 kbps... so for a 300 meg avi file, 10 parts ... 30 megs each, it's fast enough to send those small files that even if I get caught in a slow transfer, I can still get all the files in a short amount of time. but if I create too many files, it takes time to make the archives... and to decompress it .... you will find it part of this guide as "madsplit.sh" ... enjoy it. So... in order to get this done, I needed root access, install applications and I got the party going fine that way for a while... But .. you know me, got bored... or wanted to know what else this box could do... ... Ubuntu server (just a console, no GUI (or interface) .. no desktop ... just plain ubuntu 10.04 LTS server... (a black screen ... a console... ssh/pure-ftpd/rutorrent 3.2/and apache ... that's pretty much it) ... If I did a sudo reboot, I was losing the partitions, and ubuntu would'nt boot... I got help from Jeremiah over at seedboxhosting.com and he got me the script needed to play with the fstab files (partitions...) And that was a scary thing! (I required manual reboots 2 or 3 times from him after the fact because I didn't know enough about those files and I was adding multiple entries to the fstab file without knowing... ... VI is a fine text editor for linux... but I knew I could get a gnome desktop running... a vnc server ... and little by little.. line by line... reboot after reboot... it took form... I present to you this guide. Step by Step. On how to go from a simple remote ubuntu seedbox server ... (that you have root access on!) ... and make it a remote desktop VPS with google chrome installed for local (full speed) browsing and downloading. All in all (mostly copy/paste) and including my download times.. it takes about 30-40 minutes to set it all up! ![]() This is the result of many hours of trial and error, google searches and many joy and frustrations... Actually Here's everything I cover in the guide : -1: Setting partitions in the fstab and mdadm files so that when you reboot, they get mapped properly! (This step seems now obsolete, I believe seedboxhosting.com is now doing it by default! GREAT!!!) -2: We update the barebones system, and install ubuntu-desktop, the full gnome desktop! WOAHHH!!! (At 100 megabits, this doesnt take very long!, ubuntu-restricted-extras add's flash and java and mono and the like)) -3: We setup a vnc server using vnc4server, we have it start up on boot and make sure it's running smoothly! (at this point, we already have basically what we want... but I go further and propose app and desktop configurations!) -4: We remove firefox and install chrome instead, along with filezilla -5: I give you the madsplit.sh script to paste into a file. (usage: let's say your're in your /data/admin/rutorrent folder ... ./madsplit.sh file.avi 10) (This will create a subfolder called file, in there will be 10 .rar files with no compression (store) for faster compression/decompression) + you won't gain much from compressing a divx or mp3 file!) -6: Customize the desktop, add proper shortcuts to your panel, and edit some to add the sudo command! -7: Setup chrome to show your rutorrent view properly. -8: Install ubuntu tweak, and clean up the cache of aptitude) -9: I give you a link to a website that will propose a way for you to get putty to start an ssh tunnel for the vnc server and starts your vnc client to your local port tunnel in putty... if it sounds complicated, don't worry, the website is complete, this is why I linked it. 10: We install a simple pptpd vpn server! YEAH! VPN! so you can browse safely and anonymously from your computer, iphone ipad or whatever supports vpn servers!!! (When you surf the net while connected to a vpn, all your data packets will go through that vpn adapter and gets encrypted (actually, re-encapsulated within encrypted packets) and sent over your internet, up to your seedbox (well... donno what to call it anymore) server and from there it will go out on the internet! I also propose the way to fix a vnc session lock and also changing the MTU size in windows 7 / vista for the vpn adapter! so let's get started. You will find my comments with lines starting in # You will find commands to type in bold red You will find block of text to copy / paste in bold black. ![]() #From seedbox to Ubuntu VPS server in about 30 minutes. #Start Fresh: https://www.seedboxhosting.com/dashboard #From the seedbox control pannel, make sure you enable root, then hit reset, destroy my data, and reboot! #wait until it's over! ######################################################################################################### #Initial setup #(note: as of 6/30/2011, this is now done automatically, but might be useful #so only do this if you loose your /data/admin partition when you sudo reboot, otherwise skip to setup desktop! #setup vps drives to reconnect on reboot sudo su root #step already done: mdadm --assemble /dev/md0 /dev/vdb /dev/vdc mdadm -Dsv | grep md0 >> /etc/mdadm/mdadm.conf vi /etc/fstab ##use the insert key to go into insert mode in vi and use shift+insert to paste #add at the end of the lines: /dev/md0 /data ext3 defaults 0 0 #press (esc) followed by :wq #optional: reboot if you want to test it out... no need to sudo you shoud be root already... ######################################################################################################### #setup desktop sudo apt-get -y update sudo apt-get -y upgrade sudo apt-get -y install ubuntu-desktop ubuntu-restricted-extras sudo apt-get -y update ######################################################################################################### #setup vnc sudo apt-get -y install vnc4server vncserver #set a password vncserver -kill :1 sudo vi ~/.vnc/xstartup ########### paste start ################################################################################### #!/bin/sh # Uncomment the following two lines for normal desktop: unset SESSION_MANAGER exec gnome-session & [ -x /etc/vnc/xstartup ] && exec /etc/vnc/xstartup [ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources xsetroot -solid grey vncconfig -iconic & x-terminal-emulator -geometry 1024x768+10+10 -ls -title "$VNCDESKTOP Desktop" & gnome-manager & ########### paste end ################################################################################### #:wq sudo vi /etc/init.d/vncserver ########### paste start ################################################################################### #!/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="admin" #${RUNAS} # The display that VNC will use DISPLAY="1" # Color depth (between 8 and 32) DEPTH="16" # The Desktop geometry to use. #GEOMETRY="<WIDTH>x<HEIGHT>" #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 "Stoping vncserver for user '${USER}' on localhost:${DISPLAY}" su ${USER} -c "/usr/bin/vncserver -kill :${DISPLAY}" ;; restart) $0 stop $0 start ;; esac exit 0 ########### paste end ################################################################################### #:wq sudo chmod +x /etc/init.d/vncserver sudo update-rc.d vncserver defaults sudo /etc/init.d/vncserver start #you might be asked to put the password again... sudo reboot ######################################################################################################### # wait 10-15 seconds and start vnc client and make sure it works... # I Use TightVNC Viewer version 1.5.2 currently on windows 7 x64. works fine! # I setup my vnc session through ssh, (read later) but you can try it unencrypted if you trust your local network! # I set it to use 8 bit colors and custom compression set to 1 (fast) ... I DON'T CARE AT ALL IF IT LOOKS BAD! # I hate to wait for a refresh! + over a ssh tunnel .. it's even slower but thanks to 8bit.. #I don't suffer much from the added layer of security I get! Thank god! # Basic setup done. # Congrats! ######################################################################################################### #setup apps #remove firefox... sudo apt-get -y remove firefox #manually delete shortcut from panel via vnc #... install chrome instead wget https://dl-ssl.google.com/linux/direct/google-chrome-stable_current_amd64.deb chmod a+x google-chrome-stable_current_amd64.deb sudo dpkg -i google-chrome-stable_current_amd64.deb #and add yourself the panel shortcut ;) (applications/internet/googlechrome/rightclick/add to panel) #install latest filezilla sudo add-apt-repository ppa:n-muench/programs-ppa sudo apt-get -y update sudo apt-get -y install filezilla #and add yourself the panel shortcut ;) (applications/internet/filezilla) #setup your fav servers and set max connections to 10 in edit/settings/transfer #install transmission 2.31 (or latest) #then setup web server and use this instead of rutorrent... some prive trackers banned rutorrent 3.2 but not transmission... #I add transmission to my startup applications too... I kept rutorrent, it doesnt consume much cpu when it's doing nothing #+ seedboxhosting is relying on the fact that it's up and running to tell if your server is having issues... whatever sudo add-apt-repository ppa:transmissionbt/ppa sudo apt-get update sudo apt-get install transmission #create the script madsplit.sh in /rutorrent or /data/admin up to you.. or any other folders... #madsplit.sh is a little bash script I created to rar files into equal parts into a subfolder of the file name, without the extension #usage: ./madsplit.sh file.avi 10 (this example would split file.avi into 10 equal rar parts into a subfolder called file) #note: I added a 1000 byte surplus to the files to make sure I'm not ending with an extra, really small rar file. #...practical to split files for faster ftp uploading! cd /data/admin/ vi madsplit.sh ########### paste start ################################################################################### if [ $# -ne 2 ]; then echo "Usage: ./madsplit filetosplit numberofiles" else numofsplits=$2 filename=$1 foldername=${filename%\.*} mkdir $foldername rarname="${foldername}/${filename}.rar" filesize=($(stat -c%s $filename)) splitsize=$(($filesize / $numofsplits)) splitsize=$(($splitsize + 1000)) splitsize="${splitsize}B" rar a $rarname -m0 -v$splitsize $filename fi ########### paste end ################################################################################### #:wq #set it's executable flag! sudo chmod +x madsplit.sh ######################################################################################################### #customize desktop #add shortcut to terminal in panel #add shortcuts to ubuntu software center, update manager and system monitor... #but edit the link's properties and add sudo (space) in front of the commands... #start chrome setup home page to google and also http://127.0.0.1 for rutorrent display and preferences... #I add the remote-torrent-adder extension in chrome.. set it up for rutorrent 127.0.0.1 and your user/password! #if you set it up remotely change 127.0.0.1 to your seedbox ip... #install the nice to have ubuntu tweak sudo add-apt-repository ppa:tualatrix/ppa sudo apt-get update sudo apt-get -y install ubuntu-tweak #and clean a little... sudo apt-get clean #... and set the time & date properly... double check the graphical update manager... #ps: this still leaves 1.2 gigs in the root partition... (75% used) ;) #ps2: you can check in ubuntu-tweak, many options in there + a nicer cleanup tool ######################################################################################################### #Security Tip: Connect your vnc session via an ssh tunnel using putty on windows. ######################################################################################################### #pptpd vpn setup # In the following files, you will have to change the localip to your own server's ip, and change the passwords in here! # otherwise, you can keep the rest! sudo apt-get -y install pptpd sudo vi /etc/pptpd.conf ########### paste start ################################################################################### option /etc/ppp/pptpd-options logwtmp localip 91.121.238.30 #change it to your external server ip! remoteip 192.168.0.10-255 #vpn clients ip range allocation ########### paste end ################################################################################### #:wq sudo vi /etc/ppp/pptpd-options ########### paste start ################################################################################### name pptpd refuse-pap refuse-chap refuse-mschap require-mschap-v2 require-mppe-128 ms-dns 8.8.8.8 ms-dns 8.8.4.4 proxyarp nodefaultroute lock nobsdcomp ########### paste end ################################################################################### #:wq sudo vi /etc/ppp/chap-secrets ########### paste start ################################################################################### # Secrets for authentication using CHAP # client server secret IP addresses admin pptpd yourpassword * ########### paste end ################################################################################### #:wq # make sure you changed the password (yourpassword) sudo vi /etc/rc.local ########### paste start ################################################################################### #before exit 0 iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE ########### paste end ################################################################################### #:wq sudo vi /etc/sysctl.conf #remove comment: net.ipv4.ip_forward=1 #:wq #DONE! sudo reboot #You can try to connect a pptp vpn session there using your server ip, and your admin user and password ! ######################################################################################################### #further setup kernel / apps ######################################################################################################### #do any updates that the update manager has to do prior to updating the kernel... ;) needs a reboot. go ahead! #update kernel: #check latest stable: http://www.kernel.org/ #now: 2.6.39-1 #add the repository sudo add-apt-repository ppa:kernel-ppa/ppa sudo apt-get -y update #do a search..to make sure it's available... turns out only 2.6.38-8 is in the ppa now.... # aptitude search linux-headers #I found: linux-headers-2.6.38-8-server # aptitude search linux-image #I found: linux-image-2.6.38-8-server sudo apt-get -y install linux-headers-2.6.38-8-server linux-image-2.6.38-8-server sudo reboot #check kernel uppon reboot: sudo apt-get -y update uname -a ######################################################################################################### # Other Tips ############################################################################################## ######################################################################################################### ######################################################################################################### #fix vnc session lock: #If you ever try to get into vnc, and it's a nogo, your session is most likely locked. Ssh into it with putty and do: sudo rm /tmp/* -r -f sudo rm /tmp/.X1-lock -f #try reconnecting, you might need to sudo reboot! ######################################################################################################### # While on vpn in windows 7: # start putty, edit your vnc already existing session or create a new one... # under tunnels add: dynamic tunnel and remote port 8080 # in msn messenger, it wont connect unless I set it's sock proxy to 127.0.0.1 port 8080 using the tunnel... # it's weird! everything else works without the proxy! Oh well... fixed it... ######################################################################################################### # in windows vista/7: fix vpn mtu for page loading issue: # If you browse the net and some pages wont display.. but you get them to load with the vpn... do this. #---> netsh interface ipv4 set subinterface "VPN" mtu=1384 store=persistent #replace "VPN" with the name of your vpn connection.. ######################################################################################################### ######################################################################################################### # The End ################################################################################################ ######################################################################################################### That's it folks! You now have a ubuntu 10.04 server ... unless you were adventurous enough to try 11.04... (tip: don't !) You have an ftp server along with a webserver... (used for rutorrent only now..the rest is up to you) 2 torrent clients.. rutorrent ... it's fast on public torrent sites... and transmission .. I just happen to need it for private sites.. you have a vpn server that you can use to protect your privacy both at home.. or on the go if your phone / device supports vpn! you have a little script to help you in your day! and most importantly, you have a full desktop environment to play with and a vnc server to access it! I had to do all the google searching to get all the configs working so you don't have to! Enjoy! ![]() |



