How to shut down X?
To Stop X.Org Server:
sudo service lightdm stop
To Start X.Org Server:
startx
##(OR)
sudo service lightdm start
To Restart X.Org Server:
sudo service lightdm restart
In all cases, replace lightdm
with whatever greeter/display manager you use. lightdm
is Ubuntu's default display manager.