Create browser only session (Ubuntu)

2

1

I was recently in a Virgin media shop and was interested to see that they had laptops running Ubuntu for customers to browse the web on. The setup itself was interesting and I'm wondering if anyone knows how to recreate it. The features were:

Only running Firefox, no other panels or menus

I tried running a terminal (ctrl+alt+t) but it gave a message saying the user didn't have permission to access the x server (or something similar)

I realise to recreate this is a function of controlling both user privileges and session parameters but I'm not sure how I would go about it. Any ideas?

beacon_bonanza

Posted 2013-03-20T10:37:36.567

Reputation: 158

How do you know it was Ubuntu specifically? – terdon – 2013-03-20T10:39:33.543

I could tell from the window decoration on the browser (it was 11.10 I think) also I was able to use ctrl+alt+F1 to go to a virtual terminal (not log in obviously!) – beacon_bonanza – 2013-03-20T10:45:28.673

The window decorations just mean a GTK toolkit, the terminals mean any Linux distro (and probably most Unixes as well). – terdon – 2013-03-20T19:39:43.610

@terdon: On Ubuntu, entering TTY1 shows Ubuntu <version> <hostname> tty1. – Dennis – 2013-03-20T19:41:47.773

@dennis ah, ok fair enough. I was being a horrible geeky pedant anyway, I just get annoyed when Ubuntu is used as a synonym of Linux (which is what I mistakenly assumed the OP was doing). In any case, your answer will work for any *ix. – terdon – 2013-03-21T01:07:43.403

Answers

3

This is pretty easy with the Chromium Browser.1

Steps

  1. As root, create the file /usr/sbin/chromium-browser-session and fill it with the following:

    #!/bin/sh
    
    while true; do chromium-browser; done
    

    This opens the Chromium Browser in an endless loop, so it will reopen if somebody closes it.

  2. Make the file from the previous step globally executable, i.e., execute

    sudo chmod 755 /usr/sbin/chromium-browser-session
    
  3. Again as root, create the file /usr/share/xsessions/chromium-browser.desktop and fill it with the following:

    [Desktop Entry]
    Name=Chromium Browser
    Comment=Open the Chromium Browser (no window manager)
    Exec=/usr/sbin/chromium-browser-session
    TryExec=/usr/sbin/chromium-browser-session
    Type=Application
    

    This creates an option in the X display manager to initiate the X session using the Chromium Browser instead of Unity (or GNOME, KDE, etc.).

  4. Log out.

  5. Before logging in again, click the icon next to your user name and choose Chromium Browser from the drop-down menu.

  6. Log in again.

  7. Right-click the tabs bar and uncheck Use System Title Bar and Borders.ssion

  8. Resize the browser window in all four directions, so it occupies the entire screen.

  9. Right-click the tabs bar and check Use System Title Bar and Borders.

There is no window manager, so the greatest "damage" somebody will be able to do should be moving and/or resizing the browser window.

To log out, press Ctrl + Alt + F1, log in and execute

killall /bin/sh

to kill the script launching the Chromium Browser.


1 It should be just as easy with Firefox, but I don't have it installed, so I can't test it.

Dennis

Posted 2013-03-20T10:37:36.567

Reputation: 42 934