Sorry, I should have been more specific. What you have to do is kill the xserver (so that you drop to the console) and then run the commands.
You restart the xserver (to get back to the GUI) with
once you're done entering the commands there.
Now I *think* the way you kill the xserver on Ubuntu is holding CTRL-ALT-Backspace.
If that doesn't work, you can open a terminal and do
Where process number is the process ID (PID) of the xserver.
sudo kill -9 processnumber
You should be able to find that by doing
Hope that helps!
sudo ps aux | grep xserver