[XPERIA X10 Android Development] drunken_m:
Hi!

You're not stupid. But as I can see you don't really know Linux ;)

TightVNC is the program which enables you to start a graphical session in your Debian, which you can later access via a VNCviewer.

First you need to be "root" to perform most of the tasks. To do this you'll need a "rooted" X10. You can find many descriptions here on the forum on how to get your phone rooted. (Basically you need the application "Universal Androot" from the Market.)

After you have your phone rooted open a terminal emulator (I use a simple program called "Terminal Emulator" - you can get it also on the Market). After you have the terminal emulator, start it, and first type "su" - the program "Superuser Request" will start and ask you if you allow the Terminal Emulator to become superuser permissions. You just have to answer "Allow".

Now, in the Terminal you will see a "#" instead of "$" in front of each line. This means, that you are root. Now you have to use startdeb1.sh like this: "sh startdeb1.sh" (depending on where you copied the file you may have to type something else - "sh /sdcard/startdeb1.sh", or similar).

I have written startdeb1.sh so that it checks for (almost) everything which can go wrong. Most of the commands have an exit code which is written on the screen like:

losetup ... : 0
mount ... : 0
Continue inside chroot with:

cd /root ...
...

The lines starting with losetup and mount should have a 0 at the end. If everything went right you should see "sh-3.2#" instead of only "#". That means, that you are in the chrooted environment (you are inside the debian.img).

Now you have to set a few things. I've made this as easy as possible. You have to change to the /root directory and "source in" the .bashrc file like this:

cd /root
. .bashrc

If it went right the lines should now start with: "localhost:~#" instead "sh-3.2#".

After this you have to use startdeb2.sh, but don't start a desktop environment yet!

./startdeb2.sh

Is mounting necessary? -> y
Please choose a, b, or c: -> c

Now you have everything to install tightvncserver. Just type:

apt-get install tightvncserver

You will need of course a working internet connection on your phone to download the packages needed. If apt-get asks you if you want to install the packages just answer "y". If there is an error check the error messages on the screen. Maybe there is no internet connection, or maybe you have to edit /etc/apt/sources.list (see my previous posts).

If you have tightvncserver installed successful you can try to start it. Use startdeb2.sh again, but this time choose "n" for the mounts, and "a" or "b" for VNC. tightvncserver will ask for a password the first time, choose any you like. Answer "no" to the second question (guest account).

If tightvncserver started you can try to connect to it with any VNC viewer. I use "androidVNC". The settings are as follows:

Nickname: root

Password: (use the password you gave tightvncserver when it started)

Address: localhost

Port: 5901

Then hit "Connect". The first time you won't see much, only a grey background with a black "X" for mouse. If you got it until here that means you installed tightvncserver successfully.

Now you have to install some graphical environment. Close the VNC viewer and start the terminal emulator again. If you don't see "localhost:~#" then type the following commands:

chroot /data/local/mnt
cd /root
. .bashrc

I recommend installing IceWM and Xterm, for testing they are the best. Both are fast and don't require much space. Type "apt-get install icewm xterm" to install them. After they are installed you have to destroy the previously started tightvncserver and start a new one:

tightvncserver -kill :1
./startdeb2.sh

If it asks if you want to start a VNC server choose "a" for IceWM. You can try to connect to VNC again with the VNC viewer. But this time you should get not only a grey background, but a complete desktop with menu and a program called "xterm" in the top left corner.

And about $PATH: you have to learn a little about Linux to fully understand it. But the basic idea is this: you have this variable which has some places listed. You can see it's contents by typing:

echo $PATH

These are the places Linux (in this case the chrooted Debian) looks for any commands you give it. For example if $PATH is not set and you want to see a contents of a directory you would have to type: "/bin/ls". But, if "/bin" is in your $PATH you only have to type "ls", since Linux looks if it can find "ls" in the directories in your $PATH. Here is a short introduction: link