Guide: Fresh mint 16/17 install to LoL (Nvidia Optimus fix)

Write tutorials and howtos in here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Do not start a support topic here please. Before you post please read this

Guide: Fresh mint 16/17 install to LoL (Nvidia Optimus fix)

Postby Ryu945 on Tue Jan 28, 2014 6:32 pm

The purpose of this guide is to instruct how to get a computer running from a fresh installation to playing League of legends with a Nvidia Optimus card. Mines in particular is a Nvidia Optimus Geforce GT 740M. If your not interested in League of legends then this will at least help you getting graphics games working in general. The other purpose is to help you get every other thing working for you that is not working right after an operating system installation. Please keep in mind I am no expert on linux. This is what I just found to work. I plan on expanding this guide to more areas once I learn how to solve them myself. This guide was put together from me reading many guides across the internet and with experimentation.


1) Fresh install Mint 16 XFCE. That is pretty easy to do but if you need help there are probably other guides on the internet

Then run upgrade your computer:
Code: Select all
sudo apt-get update && sudo apt-get upgrade

Then update your computer using the update manager. On Mint 16 xfce, it is the shield at the bottom right.

2) First with any computer is installing some type of antivirus. I choose avast though I don't know if this is the best antivirus to get. To download it use:
Code: Select all
wget http://files.avast.com/files/linux/avast4workstation_1.3.0-2_i386.deb

Install it with:
Code: Select all
sudo dpkg -i avast4workstation_1.3.0-2_i386.deb

This anti-virus is 32 bit so to get it to work on a 64 bit system:
Code: Select all
sudo apt-get install ia32-libs

Before you run it, you have to take care of the problem that the data base grew so large that it is causing problems. If you don't do this then it will crash when you update the virus database:
Code: Select all
 sudo sysctl -w kernel.shmmax=256000000

When you run it, it will ask for a registration key which you can get for free when you register at the avast website:
http://www.avast.com/en-us/registration-free-antivirus.php


Warning: Sometimes updates to your system will wipe your kernel.shmmax change and your have to reset it.

Note: I got alot of this information off this website. http://community.linuxmint.com/tutorial/view/1463 http://forum.avast.com/index.php?topic=57812.0


3) (This step is no longer needed in Mint 17)
Now you need to add a tool to be able to create new accounts without having to use terminal. To do this run:
Code: Select all
sudo apt-get install mate-system-tools

Now when you search for "user and groups" in the launcher, you see a tool to do that.


4) Now you need a GUI to access your firewall setting. The system comes with the firewall ufw already installed but without this GUI, you have to use terminal commands. To install it, type:
Code: Select all
sudo apt-get install gufw

Be default, it is turned off so open the GUI through the launcher and turn your fire wall on.


5) Add the updated winehq and xorg edgers PPA. This is just so you have access to the lastest graphics drivers and wine. Wine is used to rune windows programs.
Code: Select all
sudo apt-add-repository ppa:xorg-edgers/ppa
sudo apt-add-repository ppa:ubuntu-wine/ppa

Then update your software repository so that it knows about what you just added:
Code: Select all
sudo apt-get update


Note: I got this information from here. http://www.winehq.org/download/ubuntu http://forums.linuxmint.com/viewtopic.php?f=42&t=140121

6) Install wine1.7
Code: Select all
sudo apt-get install wine1.7

Then launch configure wine which will be in your launcher window. In mint 16, you can search for it by typing "configure wine" in the search bar in the launcher window. It will say you are missing programs and ask you to download and install them. Let it download and install it. When it opens, you can change the version of windows it acts like under the applications tab. I chose windows 7.

7) Install winetricks. This is used to install support software to wine far easier ( like directx or adobe).
Code: Select all
sudo apt-get install winetricks


8 ) Installing Unity Web Player. This is used to play a lot of webplayer based games like the Attack on Titan one.
First add pipelight to the repository:
Code: Select all
sudo add-apt-repository ppa:pipelight/stable
sudo apt-get update

Then install pipelight-multi:
Code: Select all
sudo apt-get install pipelight-multi

Then update it:
Code: Select all
sudo pipelight-plugin --update

Then enable unity web player:
Code: Select all
pipelight-plugin --enable unity3d

Then install user agent switcher in firefox:

https://addons.mozilla.org/en-US/firefox/addon/user-agent-switcher/developers

Then download the xml to use it for firefox:

http://techpatterns.com/downloads/firefox/useragentswitcher.xml

Then import this xml by going to the firefox browser -> tools -> edit user agents -> import

Then activate it by firefox browser -> tools -> default user agent -> Browser-Windows -> Firefox 25.0 (Win 7 64 bit). This will make websites think you are on that browser instead of a linux firefox browser so they will actually offer you unity web player content. Note that 32 bit computers may have to pick a 32 bit one instead but I don't know this for sure. To finish installation, go to a page that uses the unity web player like http://fenglee.com/game/aog/ . You can now protect the the last of human race from giant titans as well as play many other games that use unity web player.

Note: While the switcher is on, the entire internet will treat you as if your using windows firefox instead. Keep user agent switch off most of the time and only turn it on when you want to use a unity web player application.

Special thanks to vpovirk in freenode irc chat for this information.


9) Using silverlight so you can watch Netflix. This assumes you have already have pipelight-multi installed (which was done in the previous step). First you needed to enable silver light if it is not already enabled (though I heard it is enabled by default. To do this type:
Code: Select all
pipelight-plugin --enable silverlight

It will ask you are you sure. Type "y" to accept. Next you need to get a different program to to fool Netflix because the other one only fools the webpage itself and not the javascript. For firefox, you can get a program called User Agent Overrider here. https://addons.mozilla.org/en-US/firefo ... overrider/

This makes an icon in the top right that has three faces. Click on it and set it to Windows / Firefox 26 . This will make both the website and the websites javascript think you are using internet explorer 11 on a windows computer. Now you can enjoy Netflix. Remember that while User Agent Overider is active, all of the internet will think your on IE11 on a windows computer so be sure to turn it off when your done with it.

Note: I got information for this here: http://ubuntuforums.org/showthread.php?t=2168913


10) Install Nvidia proprietary graphics drivers. Note that the software manager does have proprietary software in it and it is not just freeware. Also, if you have a 32 bit system, you will not need the software to allow 32 bit programs to run on 64 bit systems.

A Nvidia optimus can not use Nvidia-304 as it is to old. It can use Nvidia-319 and Nvidia-331. I choose Nvidia-331. Keep in mind my grahics card was a Nvidia Optimus Geforce GT 740M. This card uses an intel graphics card most of the time since it saves power and has to be told when to use th Nvidia card integrated with it under the current software we are under.

Fist install Nvidia-331. I personally did not run this in terminal because I read that the software repository takes care of Nouvea problems when you use the GUI and I just didn't want to take any chances. To install it this way, simply launch the Software Manager and search for nvidia-331. Then tell it to install it.

Then install bumblebee-nvidia. This helps your computer manage the optimus part of the nvidia card.

Then install primus. This allow your bumblebee to work with your nvidia drivers with 64 bit programs

Then install primus-libs-ia32:i386. This allow bumblebee to work with your nvidia drivers with 32 bit programs.

In total it should have installed primus, primus-libs, primus-libs-ia32:i386, primus-libs:i386 when you installed those two primus packets.

If you want to use termnal commands then use these:
Code: Select all
sudo  apt-get install nvidia-331
sudo  apt-get install bumblebee-nvidia
sudo  apt-get install primus
sudo  apt-get install primus-libs-ia32:i386


Then restart your computer. Once it is back up test to make sure everything is working. Types this into terminal:
Code: Select all
optirun glxgears -info

You should see gear spinning animation and the terminal will type a lot of text. Above all that text, it should say you are using the Nvida card.


11) Installing League of Legends via Playonlinux. I have found this way works far better then installing it directly into wine as they handle a lot of the bugs you run into. This will not fix the bug with the out of game shop though. First install playonlinux from software repository or use:
Code: Select all
sudo apt-get install playonlinux

Then run it, it will ask to install several things. Let it install them. Once open click on install to install a new program. Check the testing box so your able to see League of Legends. Type League of Lengends into the search box. Click to install it and it will ask to install more things so let it. Then it will ask whether to download it or for you to provide the file. Click download. I have heard that the Playonlinux version is specially edited to get it working on Linux. Concntinue going through the menus until everything is finished. Do not let it launch the game at the end.

Launch the game via Playonlinux and let it patch once it finishes, close the game.


12 ) [I recommend that you skip step this now as the Playonlinux version works better but the infomation is there is case you want it.]
Installing League of Legends. The ne[er installer will not work you have to use the old one that has Kassadin holding the computer. Make sure the computer knows to run it as a wine program by changing it properties via right clicking it. Before running the installer, get the programs league of legends needs. Note that I don't know if all of these are actually needed. I just know this works. In winetricks type:
Code: Select all
 winetricks vcrun2005
 winetricks vcrun2008
 winetricks wininet
 winetricks d3dx9
 winetricks corefonts
 winetricks adobeair


Adobeair will try to update. I just chose to let it update.

Now install league like you would any widows program. Do not change the directory though I don't know if that will cause problems or not. Once it finishes, let it patch. Close it once it finishes patching.


Note: I got information from this guide http://forums.na.leagueoflegends.com/board/showthread.php?t=1946188 http://forums.na.leagueoflegends.com/board/showthread.php?t=4130419



13) Fix the in game item shop. Since Wine is not able to handle mipmaps from textures smaller than one block, TuxLoL is intented to patch these files from League of Legends to make the game run. Download it here:

https://bitbucket.org/Xargoth/tuxlol/wiki/Home

Extract the files and then change your directory in terminal to the folder of the python files. Be sure to back up your league of legends folder incase something goes wrong:
Code: Select all
cd /home/<your log on name>/Downloads/LoL-Linux-Tools-master

Then open the config.py file and place your league of legends folder directory in it. On my system it looks like this:
Code: Select all
lol_path = '/home/<your log on name>/.wine/drive_c/Riot Games/League of Legends/

On Playonlinux it looks like this:
Code: Select all
lol_path = '/home/<your log on name>/.PlayOnLinux/wineprefix/LeagueOfLegends/drive_c/Riot Games/League of Legends/'


Run the program in terminal:
Code: Select all
python lol_linux.py texture_patch


Note that this can take awhile and doesn't give your sceen an update for awhile. You will know it is done when you computer is showing <log in name>@<computer name>

I got information from here. http://forums.na.leagueoflegends.com/board/showthread.php?t=4130419


14) Fix the launching shortcut.

As you may remember I told you Nvidia has to be told to run for the way the sofware works now. Otherwise it will use the intel graphics card which will start the game fine but it can not be used to play league of legends. This can be done with either optirun or primusrun. I choose primusrun because I heard it runs more efficiently and keeps the computer cooler.

Your shortcut looked like this before:
Code: Select all
env WINEPREFIX="/home/<your log on name>/.wine" wine C:\\windows\\command\\start.exe /Unix /home/<your log on name>/.wine/dosdevices/c:/users/Public/Desktop/Play\ League\ of\ Legends.lnk

Change it to this to run optirun:
Code: Select all
env WINEPREFIX="/home/<your log on name>/.wine" primusrun wine C:\\windows\\command\\start.exe /Unix /home/<your log on name>/.wine/dosdevices/c:/users/Public/Desktop/Play\ League\ of\ Legends.lnk

However, there is also some other bug going on right now and I know it can be fixed by changing the command to look like this:
Code: Select all
env WINEPREFIX="/home/<your log on name>/.wine" PRIMUS_SYNC=2 primusrun wine C:\\windows\\command\\start.exe /Unix /home/<your log on name>/.wine/dosdevices/c:/users/Public/Desktop/Play\ League\ of\ Legends.lnk

When using Playonlinux you have to run Playonlinux from the terminal using:
Code: Select all
PRIMUS_SYNC=2 primusrun playonlinux

To permanently set it so that playonlinux is run automatically like this in mint 16 xfce, go to:

/usr/share/

Then open the applications folder as root via right clicking it and going to the correct menu option. Then go to Playonlinux. Go to the Launcher tab. Change the area under Command from:
Code: Select all
playonlinux

to:
Code: Select all
env PRIMUS_SYNC=2 primusrun  playonlinux


Now you also want to put this on your shortcuts in application menu. In XFCE, this is stored in three locations:
Code: Select all
/usr/local/share/applications
/usr/share/applications
~/.local/share/applications


The last one effects applicatons only that particular account can see. The other two effects things everyone can see.

You go to the last one by going to the home area for your log in name and pressing "ctrl" and "h" so that you can see hidden files. Pressing "ctrl" and "h" again will rehide them. In front of every application you want to run with your nvidia graphics card put this in the command:
Code: Select all
env PRIMUS_SYNC=2 primusrun


Note: I got information from this website: http://ubuntuforums.org/showthread.php?t=1355011


15) Fixing your CD/DVD/Blueray Player /dev/dvd link. Your notice if you try to play a dvd that it will give you an error message about not being able to find the dvd. It might look like this:

Playback failure:
DVDRead could not open the disc "/dev/dvd".
Your input can't be opened:
VLC is unable to open the MRL 'dvd:///dev/dvd'. Check the log for details.


This is because /dev/dvd is what media players like vlc generally call to play your dvd drive but it will not necessarily know where that is actually located on your computer. In VLC go to file->Open Disk. Your see a drop down menu that is by defualt set to /dev/dvd. Change this and hit play until you find the correct one. For me it is /dev/sr0 .



We need to create a symlink to permanently link /dev/dvd to /dev/sr0. You can't just create a normal symlink as rebooting your computer wipes it. You have to tell the computer to create it upon boot. To do this go to the file with root privileges:

/etc/udev/rules.d/70-persistent-net.rules

You can do this by right click rules.d and telling it to open with root privileges. Then just open the file normally. Paste this line at the bottom of the file, save and close it:
Code: Select all
KERNEL=="sr0", SYMLINK+="dvd", NAME="dvd_player_link"

This will create symlink upon boot that links /dev/dvd to /dev/sr0 and this symlinks name is dvd_player_link. Remember to close the folder you opened as root.


16) Getting your computer to play DVDs. First you need to get the codecs required as they do not ship with the operating system. You do this by typing this in the terminal:
Code: Select all
sudo apt-get install ubuntu-restricted-extras

For most people, this will allow you to play DVDs but on new DVD players, you will need to set the region to something before it will work at all. To do that type this interminal:
Code: Select all
sudo regionset

It will ask you if your sure you want to do this. Hit "y" . Then enter the number of the region you want. For US, that is 1. Here is a list of regions. http://www.wisebread.com/make-your-dvd-player-region-free-in-seconds

Note: I got information from this website: https://help.ubuntu.com/community/RestrictedFormats/PlayingDVDs


17) Installing VirtualBox.

There are a lot of programs you can use on Linux in place of Windows programs but there are also some that don't have equivlents. One way to solve this problem is to install a virtual box. An advatange virtual boxes have over dual booting is that Virtual Boxes can prevent Windows viruses from affecting your Linux system while that protection is not in place if you dual boot. Note that you will lose this protection if you run a virtual box with sudo (aka root privledges). The disadvantage is this is more computer intensive as you have to run both the operatng systems at once. It also can not run graphics intensive games. You can install it from the software repository or use the command:

Code: Select all
sudo apt-get install virtualbox-4.3


After installing it, you need to get another operating system either through iso file or disk. Then boot off that disk from within the virtual box to install it. The menus at the top of a powered on system allow you to mount iso files/cds/dvds/etc... Your also need to install guest additions after you have the operating system working. To the already booted up computer and at the top Devices->Insert Guest Additions CD Image . This will start an installer for guest additions which is needed for useful features. To make a shared folder, first creat a folder you want to be shared on your host computer. Then go to Oracle VM Virtual Box Manager and click on the settings button while selected on the operating system your adding the folder to. Then go to shared folders in that menu that pops up. Click the icon near the top right to add the folder. Do not check anything. Hit okay on that and settings menu. Then go over to your already booted windows virtual OS and open the command prompt by going to the window button and clicking it. Then type this in run:
Code: Select all
cmd


In the command prompt type:
Code: Select all
net use x: \\vboxsvr\sharename


You can change the "x" for what eve letter you want the drive to be but it can not be one already in use. You can change "sharename" for the name you want the drive to be called on the windows OS. After that it should be connected and working.


I got information from here: http://linux.m2osw.com/copy-files-betwe ... x-and-host



18) Basic security improvements. These are some very simple things to improve your security.

Install firefox addon https everywhere: https://www.eff.org/https-everywhere

This allows you to automatically use a web pages secure version without having to manually type out the url of the secure version. Now that this can mess up Netflix so you might have to turn it off when going to Netflix.


Install firefox addon noscript: http://noscript.net/

This disables javascripts on all pages except the ones you whitelist. If you find this gets to annoying to use, it is still recommeded you keep it but tell it to allow scripts globally. This still provides you with some protection even when disabled like that.


Use DuckDuckGo or Start Page. DuckDuckGo is basically Yahoo's search engine but they do not monitor you like Yahoo does. Using it also helps fund Linux Mint development. Start Page is basically Google search engine but they do not monitor you. They don't help fund Linux Mint but I find Google has a far superior seach engine to any other one out there.



19) Installing Tor. Tor is a program that uses a network of computers in the Tor network to bounce data around so that it can't be tracked. This is used to protect the privacy of individuals and businesses. It is also used so the media can get important information while not exposing their sources. The military and law enforcement use it to protect their communications. If you want to help out, you can run a Tor node. If you just want the broswer, go hear and download it:

https://www.torproject.org/projects/torbrowser.html.en

It only comes fully configured on firefox. It is recommended you use this instead of trying to configure it for another browser as you may mess up the configuration and leave some type of security vulnerability. It is also recommend that you do not change any settings or install any addons on it. If you want to make this convient to launch, change the folders name to have a "." in front of it and place it in your /home/<log in name> folder. The "." makes it invisible so it will not clutter up your folder. You can view/hide hidden files with ctrl + h or Then follow 14) on how to make a launch shortcut.


The https everywhere addon can use Tor if you install it on the computer itself. Below are the instructions on how to do that but I recommend you check out the page itself to see if anything has changed (like the key could have changed). It is also recommend that you use this site and not any auto made packages since those are not maintained by the Tor Project:

https://www.torproject.org/docs/debian.html.en

First add the them as a source for your updates. Go to Software Manager-> Additional Repositories - Add New Repository . It shows me this since I am Saucy:

Code: Select all
deb http://packages.domain.com/ saucy main


You need to add this to it:

Code: Select all
http://deb.torproject.org/torproject.org


It will look like this when done:

Code: Select all
deb http://deb.torproject.org/torproject.org/ saucy main


Then add the gpg key used to sign the packages by running the following commands at your command prompt:

Code: Select all
sudo gpg --keyserver keys.gnupg.net --recv 886DDD89
sudo gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -


Then refresh your software sources:

Code: Select all
sudo apt-get update


To keep your key current, install this:

Code: Select all
sudo apt-get install deb.torproject.org-keyring


To install Tor:

Code: Select all
sudo apt-get install tor



This will allow you to not only have the addon https everywhere communicate securely over Tor; It will also allow you to set up a Tor node or service, however it does not have a GUI to make it easy. If you want a GUI use Vidalia. You can get a detail guide here:

https://www.torproject.org/docs/tor-doc-relay.html.en

You can download it here:

https://people.torproject.org/~erinn/vi ... e-bundles/

Remember that you need to open both the entry and exit ports for your Tor relay to work.


20) Fixing brightness control. (added in mint 17)

You need to add the kernal parameter:
Code: Select all
video.use_native_backlight=1


Before adding it permanently, you should test it out first. To test it out.

a) Reboot your computer and hold shift until you get to your grub menu

b) press "e"

c) Go to the line that says linux

d) At the very end of that line, put a space and then:
Code: Select all
video.use_native_backlight=1


e) Press ctrl + x

This will boot with that kernal parameter set for this time only. You should be able to use the function keys to adjust brightness now. If everything is working fine then it is time to add it permanently. To do that:

a) Type this in terminal:
Code: Select all
sudo gedit /etc/default/grub


b) Type in your password and go to the line that has:
Code: Select all
GRUB_CMDLINE_LINUX_DEFAULT


You should see:

Code: Select all
"quiet splash"


Add video.use_native_backlight=1 so it looks like

Code: Select all
"quiet splash video.use_native_backlight=1"


c) Save it and close it. Then type:
Code: Select all
sudo update-grub



d) Restart your system when it is done. You should now be able to change your brightness.


I got my information from this website: https://wiki.ubuntu.com/Kernel/KernelBootParameters and https://forum.xfce.org/viewtopic.php?pid=34310#p34310
Special thanks to ToZ



Congradulations, you now have avast, nvida optimus, wine,league of legends, silver light, netflix, unity web player, got shortcuts working, Set up a Virtual Box, set up a secure Tor Browser/Tor Relay and improved you browser security. There is Demacian Justice in the world.


Additional Knowledge: Now I'm going to tell you some basic things your probably want to know.

A) To make an iso file of a disk run:
Code: Select all
dd if=/dev/cdrom of=~/Name.iso

This will put it in your accounts home directory.

To run a command as root from a limited account:
Code: Select all
su -c '<command>'

It will then ask you for the root password so enter it and hit enter. sudo is not needed.

To see what processes are running, type this in terminal:
Code: Select all
top

To stop viewing it type:

Code: Select all
q


To stop a process forcibly then type:
Code: Select all
kill <process_number>

To add and remove autostart programs, launch session and startup from application menu.



B) To add links to your application menu, go to:

Code: Select all
/usr/share/applications/


The xml files in there are what populate your applicaton menu. Copy one with similar properities you want like in the game category and paste it to desktop. Then edit it as you see fit. Then open that applictions folder as root and paste your new file in. You should now see that link you made. Remember to rename it because the files have a display name and an actual name. You can't have files with the same actual name in the same folder.


C) To do a boot repair along with other useful things, run the program ferret. Details on how to run it are on the website. You can download it here:

https://github.com/crimsonmane/nightsha ... erret-wiki

D) To make a symlink:

Code: Select all
 ln -s linktofile linktosymlink/name


If there is a space in the name, you will need to put "\" in front of the space. If you put no location for the symlink and just its name; it will go in home folder.




If someone that understands linux better can clarify things or knows how to make more professional fixes then post below so I can update the guide.
Last edited by Ryu945 on Thu Sep 11, 2014 11:47 am, edited 57 times in total.
Linux Mint 16 XFCE 64 Bit
Ryu945
Level 2
Level 2
 
Posts: 59
Joined: Thu Nov 28, 2013 11:47 pm

Linux Mint is funded by ads and donations.
 

Re: Guide: Fresh mint 16 intstall to LoL (Nvidia Optimus fi

Postby ninaxthorn on Tue Jan 28, 2014 10:02 pm

Looks like a good catch for a gamer like me. Thanks Ryu!
^^Nina08^^
ninaxthorn
Level 1
Level 1
 
Posts: 4
Joined: Tue Jan 28, 2014 4:52 am

Re: Guide: Fresh mint 16 install to LoL (Nvidia Optimus fix

Postby Pilosopong Tasyo on Mon Mar 17, 2014 3:03 am

Moved to Tutorials / Howtos.
Image
o Give a man a fish and he will eat for a day. Teach him how to fish and he will eat for a lifetime!
o If an issue has been fixed, please edit your first post and add the word [SOLVED].
User avatar
Pilosopong Tasyo
Level 6
Level 6
 
Posts: 1137
Joined: Mon Jun 22, 2009 3:26 am
Location: Philippines

Re: Guide: Fresh mint 16 install to LoL (Nvidia Optimus fix

Postby tape_ape on Tue Apr 22, 2014 8:13 am

Thanks for this, Ryu945. Not a gamer so i just cherry-picked the optimus/nVidia stuff. Seems to be working fine!
tape_ape
Level 1
Level 1
 
Posts: 2
Joined: Wed Nov 03, 2010 10:59 am


Return to Tutorials / Howtos

Who is online

Users browsing this forum: altf4 and 6 guests