How do I gain root privileges in Ubuntu Desktop 12.04? I installed to a USB stick to try it out. Now when I installed it on a VM, I don't have the same options as I did on the USB stick, such as opening remote desktop, installing drivers, and some of the video capabilities.
There are 2 ways to do things with elevated permissions.
sudo lets you run commands in your own user account with root privileges.
su lets you switch user so that you're actually logged in as root.
But this options is by default disabled on Ubuntu. Instead you can simply start a root shell with
Read What are the differences between "su", "sudo -s", "sudo -i", "sudo su"? for more information.
Use either method only as and when needed, they can cause your system damage if used without caution.
This should make you root after you enter your user's password, assuming you were the first account to be created. Be careful when you're root. Only login as root when you really need to, and logout as soon as you're done.
sudo su -
Alternatively you can run specific commands with root privileges by prepending them with
sudo. For example:
sudo cp -p foo bar/
You cant gain something you already have. If you can use sudo, than you dont need to gain it.
Ua, excuse me... But sudo is not how you "gain" root privileges. sudo is used when you already have root level access from the admin group and want to use it.
The question implies "gain" as something that you do not have. Probably not written correctly.
Common Example: So you need sudo, or root on your computer but you can't use sudo BECAUSE you need to "gain" the privilege because you accidentally locked your self out etc. by editing sudoers and removing yourself because you thought you could login as root on Ubuntu.
sudo doesn't solve everything. And you can't gain something you already have.