Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am following This Tutorial to make my Android an external monitor for my Ubuntu 12.04 computer.

How do I do the following:

Edit your vnc session file

$ vi ~/.vnc/xstartup

Comment out everything and put this at the end

gnome-session &

share|improve this question
up vote 4 down vote accepted

With sed and echo are 2 commands in terminal . I am not using vi (editor) I prefer the simplest nano (editor) but now we will use sed (stream editor) and echo (line displayer) combined with tee (reader) trough a pipe | .

sed 's/^/#/g' -i ~/.vnc/xstartup

echo 'gnome-session &' | tee -a ~/.vnc/xstartup

If the file is admin protected (needs privileges) then

sudo sed 's/^/#/g' -i ~/.vnc/xstartup

echo 'gnome-session &' |sudo tee -a ~/.vnc/xstartup


share|improve this answer
Thank you. This did what I wanted. – pgrytdal Oct 10 '12 at 20:50

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.