Why Do it?
I dual boot Ubuntu and Windows 7.
It annoys me when I setup something on one operating system only to lose that feature when I’ve booted into the other one.
If you’re like me, you’re signed up to private torrent websites which require you to keep a share ratio. I like to keep uTorrent open all the time so I can seed.
Steps
- Install wine. In Ubuntu this can be done with
sudo apt-get install wine
- Ensure all of your windows partitions are mounted on boot. This requires you to modify your /etc/fstab. You can edit it with any text editor but I like to use:
sudo gedit /etc/fstab
My fstab has the following two lines to mount my two 1TB drives from /dev/sdb1 and /dev/sdc1 into /media/Terabyte and /media/Terabyte2:
/dev/sdb1 /media/Terabyte2 ntfs-3g defaults,locale=en_CA.UTF-8 0 0 /dev/sdc1 /media/Terabyte ntfs-3g defaults,locale=en_CA.UTF-8 0 0
Note: if you’re using Ubuntu, a quick way to figure out what device your drives are showing up as is to mount the drive through the Places menu and noting the directory it creates under /media. You can then run the `mount’ command by itself to show a listing of all mountpoints on the system.
- Ensure Wine has access to your Windows partitions in the same drive letters that Windows gives them.Wine creates a bunch of symbolic links under ~/.wine/dosdevices. So in order to make your drives show up the same as windows, you just have to make a couple of symbolic links. There’s going to be a few symbolic links already, but they should be safe to delete. (Note: if you need to delete the d: symlink because thats where your drive shows up in Windows, you should probably just rename it to something else, otherwise you won’t have a CD-ROM drive in Wine)Assuming your drive is mounted in /media/Drive and you want it to show up in Windows as drive f: you would run the following commands:
cd ~/.wine/dosdevices rm f:
ln -s /media/Drive f:
- Now that we’ve got our environment setup, it’s time to install uTorrent in Wine. I’m using Windows 7 so my uTorrent installation lives in C:/Program Files/uTorrent and it stores Application Data in C:/Users/josh/AppData/Roaming/uTorrent.Wine stores it’s program files in ~/.wine/drive_c/Program Files/ and Application Data in ~/.wine/drive_c/windows/profiles/user/Application Data.So, let’s setup a symlink from wine to point to our Windows installation. That way they’ll stay perfectly in synch with eachother even if I upgrade uTorrent from Windows. Awesome!So, to create the two symlinks, run the following commands:
ln -s /media/C/Users/your_windows_username/AppData/Roaming/uTorrent \ ~/.wine/drive_c/windows/profiles/your_linux_username/Application\ Data/ln -s /media/C/Program\ Files/uTorrent ~/.wine/drive_c/Program\ Files/
and that’s pretty well it!
- Testing the installation.Note the /NOINSTALL option to uTorrent prevents it from doing some installation tasks that aren’t required in our new environment.
wine "/home/your_linux_username/.wine/drive_c/Program Files/uTorrent/uTorrent.exe" /NOINSTALL
- Setting up a script so you don’t have to type that long command all the timeRun the following commands:
sudo touch /bin/uTorrent sudo chmod +x /bin/uTorrent sudo gedit /bin/uTorrent
and place the following 2 lines into the file:
#!/bin/bash
wine "/home/josh/.wine/drive_c/Program Files/uTorrent/uTorrent.exe" /MINIMIZED &> /dev/null &
Note that &> /dev/null & detaches the command from the terminal and runs it as a background process
- Setting uTorrent up to start when Windows starts.In Ubuntu this is real easy. Just go to System -> Preferences -> Startup Applications and add a new application with:
Name: uTorrent
Command: uTorrent
Comment: Run uTorrent at System launch
And that’s all you have to do. Some people will say that you shouldn’t use a Windows torrent client in Linux but hey, uTorrent is absolutely the best torrent client for Windows and I’ve been synchronizing it in Linux for months now without any problems. Happy torrenting.