Running Fedora on the Galaxy S part 2

I recently did a posting on running Fedora on my Samsung Galaxy S. I have been asked for some more details and screenshots. So here goes.

Setting up the fedora environment is well described in the last posting, no need to repeat that. A screenshot should do:

Starting fedora

For convenience, I added a script for entering the chroot from another shell, without remounting the kernel filesystems again.

# grep -v busybox /data/local/bin/startfedora | grep -vi mount > /data/local/bin/enterfedora
# chmod +x /data/local/bin/enterfedora

I detest running applications as root when I don’t have to. So I figured a way to start the X server (Xvnc) as root (by sudo), and made a custom script starting a vnc session as an unprivileged user. Install sudo, add a sudoers line with visudo like this

yourusername  ALL=(root)       NOPASSWD: /usr/bin/Xvnc, /usr/bin/kill

A sample script myvncserver may be found here. Place it in /usr/local/bin and make it executable.

As a desktop example, I used XFCE. Place your phone on the loader, that will take some time.

# yum groupinstall XFCE

Then add a local xstartup script in /home/myusername/.vnc/xstartup that looks something like this:

#!/bin/sh
sleep 2
xfce4-session > ~/xfce4-session.log 2>&1
myvncserver -kill
pkill gam_server

Make it executable, and run it. Look for problems in ~/xfce4-session.log and ~/.vnc/localhost:1.log Then connect to host 127.0.0.1 port 5901 via your favourite android vnc viewer.

Here’s an example video session:
Galaxy S Fedora desktop

Making the web browser work was a bit tricky. A process running as a non-root user on android has no rights except those granted specifically. After a bit trial and error, I found that the security model is based on the user id. As long as the application granted specific rights is running, another process running with the same uid may use the same rights. So in short, to allow a fedora chroot web browser connect to the Internet, pick a uid for your local user, matching that of another web browser on the phone, and run that browser in the background. DNS lookup has similar problems, I guess android uses some internal nss lookup methods, so calls to external DNS servers are not allowed. At least, they are not allowed for com.allow.browser. I ended up putting some example addresses in /etc/hosts… … or you could run the web browser with sudo, but that is generally known as a bad idea. So what I need now is a very small footprint android app that has full Internet connection, and can run in the background. Should be easy to find, I guess.

That’s it, actually. Remember to stop all running fedora services before logging out of the fedora chroot.

5 Responses to “Running Fedora on the Galaxy S part 2”

  1. leonel says:

    Great work.

    Does that displays on the galaxy screen ??
    I mean can I access my fedora system from my phone with no need of another computer?

  2. leonel says:

    Great! I’ve seen the video ..

    It works ..

  3. Peter Laucks says:

    Can you tell me how to add a script to startup?
    I keep getting the same error message:
    Running in chroot, ignoring request.

    Thanks

  4. ingvar says:

    Peter, sorry, I haven’t done anything more than what I described in the post.

  5. Peter Laucks says:

    Thanks just the same. Great writeup!

Leave a Reply