Auto open browser on boot
Hi all,
I've been tasked a small project... A sales office wants to use a Pi as a information dashboard up on the wall which involves it just displaying a webpage hosted locally.
I need the Pi to automatically boot, open a browser full screen (F11 stylee) and point to a page.
I would be very grateful for any input!
Mike.
I've been tasked a small project... A sales office wants to use a Pi as a information dashboard up on the wall which involves it just displaying a webpage hosted locally.
I need the Pi to automatically boot, open a browser full screen (F11 stylee) and point to a page.
I would be very grateful for any input!
Mike.
Re: Auto open browser on boot
To launch a command automatically on login, put the command into a file named
.bashrc
in the user directory (for example /home/pi)
For example, the file could contain
chromium-browser --kiosk www.google.com
to launch Chromium in full-screen pointed to www.google.com
.bashrc
in the user directory (for example /home/pi)
For example, the file could contain
chromium-browser --kiosk www.google.com
to launch Chromium in full-screen pointed to www.google.com
Re: Auto open browser on boot
fantastic, worked a treat 
Thank you!

Thank you!
Re: Auto open browser on boot
PM received thanks Bredman, it wont let me reply as I assume i'm a new user. Will keep you posted.
-
- Posts: 70
- Joined: Tue Jul 31, 2012 11:33 pm
Re: Auto open browser on boot
exactly what I need as well!, possible to disable mouse courser from the system completely? I can use all keyboard commands and this would remove it from showing up onscreen when restarted. Thanks for any help!
- Super-Nathan
- Posts: 67
- Joined: Sun Jun 17, 2012 6:56 am
- Location: South Korea
Re: Auto open browser on boot
Frankly your best bet would be to install openbox and have openbox open the bowser for you. this would give you a fullscreen webbrowser with NOTHING else. no statusbar, no time, no startmenu, nothing but the browser.
and then make a openbox config file with
Then edit the autostart to openthe browser at boot
remove all the code and past this in:
that will make it run with fewer options auto resetting after 2 minutes inactivity
Code: Select all
sudo aptitude install openbox obconf obmenu
Code: Select all
mkdir -p ~/.config/openbox && cp /etc/xdg/openbox/* ~/.config/openbox
Code: Select all
nano ~/.config/openbox/autostart
Code: Select all
# Autostart script
#will sleep to make sure everything else loads
sleep 5s && midori --inactivity-reset=120 -e Fullscreen --app=/PATH/TO/HOMEPAGE/FILE.html
echo "Something Useful" > /dev/null
- Super-Nathan
- Posts: 67
- Joined: Sun Jun 17, 2012 6:56 am
- Location: South Korea
Re: Auto open browser on boot
bredman wrote:To launch a command automatically on login, put the command into a file named
.bashrc
in the user directory (for example /home/pi)
For example, the file could contain
chromium-browser --kiosk http://www.google.com
to launch Chromium in full-screen pointed to http://www.google.com
Chromium is MUCH to slow to browse comfortably on the pi,especially with lxde overhead which you do not need. you WILL see speed increases with openbox/midori!
echo "Something Useful" > /dev/null
-
- Posts: 30
- Joined: Tue Jan 08, 2013 9:48 am
Re: Auto open browser on boot
I have done this but it does not recognise chromium-browser.... I changed it to simply chromium instead but I get the error (chromium:2100): Gtk-WARNING **: cannot open display:To launch a command automatically on login, put the command into a file named
.bashrc
in the user directory (for example /home/pi)
For example, the file could contain
chromium-browser --kiosk www.google.com
to launch Chromium in full-screen pointed to www.google.com
If I set the pi to boot in to the GUI on startup then it gets to the GUI without opening chromium but if I try to open the terminal suddenly the pi starts chromium in kiosk mode.......
What am I doing wrong?
Re: Auto open browser on boot
Try putting the following line just before the one invoking your browser.
export DISPLAY=:1
The line you had which created an error is probably the right command. I am not sure whether 1 is the right display number, but I have the above line in my .bashrc on a host box I VNC into, so I can start GUI apps from command line when I want to.
Since it is coming back with :2100 in your error message, you might try display number :0
Also, I would be concerned about starting the app from your .bashrc and not ending the line with an ampersand so that .bashrc can finish any other things you might place there in addition, after calling the browser. Otherwise, .bashrc will not close until you close chromium.
export DISPLAY=:1
The line you had which created an error is probably the right command. I am not sure whether 1 is the right display number, but I have the above line in my .bashrc on a host box I VNC into, so I can start GUI apps from command line when I want to.
Since it is coming back with :2100 in your error message, you might try display number :0
Also, I would be concerned about starting the app from your .bashrc and not ending the line with an ampersand so that .bashrc can finish any other things you might place there in addition, after calling the browser. Otherwise, .bashrc will not close until you close chromium.
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B
-
- Posts: 30
- Joined: Tue Jan 08, 2013 9:48 am
Re: Auto open browser on boot
I have tried export DISPLAY=:1 and export DISPLAY=:0
Both give me the error "Cannot open display:1" or "Cannot open display:0"
Both give me the error "Cannot open display:1" or "Cannot open display:0"
Re: Auto open browser on boot
I hope somebody can solve that, I get the same thing when I try to open a VNC server on my Pi, so do not know the answer at this point.coolblue2000 wrote:I have tried export DISPLAY=:1 and export DISPLAY=:0
Both give me the error "Cannot open display:1" or "Cannot open display:0"
FORUM TIP: To view someone's posting history, sign in, click on their user name, then on "Search User's Posts." || Running ArchLinuxArm on Model 2B and 512MB Model B
-
- Posts: 30
- Joined: Tue Jan 08, 2013 9:48 am
Re: Auto open browser on boot
Ok, I have got it working. It seems you can't start chromium from bash as it there is no gui so fails.
I got chromium to start on boot by adding "@chromium --kiosk www.bbc.co.uk" to the "autostart" file in /etc/xdg/lxsession/LXDE/
One problem though.....
On my home pi this works fine (not going through a proxy at home), however on the one at work chromium complains that it can not connect to the proxy server.
The proxy is setup on the pi and if I start Chromium from the desktop it works fine, also if I start chromium from terminal using "Chromium --kiosk www.bbc.co.uk" it also works fine.
Why is it complaining about the proxy server when it is started from the autostart file? And is there a way to specify the proxy in the "@chromium --kiosk www.bbc.co.uk" line?
Also if I autostart with the following line @chromium www.bbc.co.uk
ie not in kiosk mode so I have access to the menus, the same thing happens, but if I click refresh it works fine.... So it looks like a timing issue possibly?
If I use @chromium --proxy-auto-detect www.bbc.co.uk I no longer get the proxy server error, however I get a webpage not available error instead. If I refresh it works fine.....
Do I need to somehow pause the execution of chromium for a few seconds in order for the desktop to catch up? If so how do I do this in the autostart file?
I got chromium to start on boot by adding "@chromium --kiosk www.bbc.co.uk" to the "autostart" file in /etc/xdg/lxsession/LXDE/
One problem though.....
On my home pi this works fine (not going through a proxy at home), however on the one at work chromium complains that it can not connect to the proxy server.
The proxy is setup on the pi and if I start Chromium from the desktop it works fine, also if I start chromium from terminal using "Chromium --kiosk www.bbc.co.uk" it also works fine.
Why is it complaining about the proxy server when it is started from the autostart file? And is there a way to specify the proxy in the "@chromium --kiosk www.bbc.co.uk" line?
Also if I autostart with the following line @chromium www.bbc.co.uk
ie not in kiosk mode so I have access to the menus, the same thing happens, but if I click refresh it works fine.... So it looks like a timing issue possibly?
If I use @chromium --proxy-auto-detect www.bbc.co.uk I no longer get the proxy server error, however I get a webpage not available error instead. If I refresh it works fine.....
Do I need to somehow pause the execution of chromium for a few seconds in order for the desktop to catch up? If so how do I do this in the autostart file?
-
- Posts: 1277
- Joined: Fri Sep 14, 2012 9:13 am
Re: Auto open browser on boot
Super-Nathan wrote:Frankly your best bet would be to install openbox and have openbox open the bowser for you. this would give you a fullscreen webbrowser with NOTHING else. no statusbar, no time, no startmenu, nothing but the browser.
and then make a openbox config file withCode: Select all
sudo aptitude install openbox obconf obmenu
Then edit the autostart to openthe browser at bootCode: Select all
mkdir -p ~/.config/openbox && cp /etc/xdg/openbox/* ~/.config/openbox
remove all the code and past this in:Code: Select all
nano ~/.config/openbox/autostart
that will make it run with fewer options auto resetting after 2 minutes inactivityCode: Select all
# Autostart script #will sleep to make sure everything else loads sleep 5s && midori --inactivity-reset=120 -e Fullscreen --app=/PATH/TO/HOMEPAGE/FILE.html
I am working on a similar project.
I tried this, but it doesn't launch at startup.
and If I say "startx" after logging in, it starts the default GUI
can I skip login and just directly into the browser?
Tx.
Steve
Chromium Full Screen on Boot
Hello, I am in charge of making the switch in how we do digital signage at our University, and was experiencing problems with Midori crashing. We are switching to "Chromium" to see if that will work better, but I was wondering if there was anyone that could advise me on the code to do this. I need Chromium to start on boot and open a specific webpage in Full Screen. I will list the code that seemed to be working on Midori until it crashed below. Thanks.
This is in a file that I created and made executable.
• #!/bin/bash
• midori –e Fullscreen –a http://display.northcentral.edu/screen/?mac=`ifconfig | grep HWaddr | tr –s “ “ | cut –d “ “ –f 5`
This is in a file that I created and made executable.
• #!/bin/bash
• midori –e Fullscreen –a http://display.northcentral.edu/screen/?mac=`ifconfig | grep HWaddr | tr –s “ “ | cut –d “ “ –f 5`
Re: Auto open browser on boot
Sorry to kick up an old thread...
We're using the instructions here - https://github.com/MobilityLab/TransitS ... spberry-Pi to set-up a "web screen" that loads a webpage on boot, and nothing else.
The page in question has a username/password access system. Is there a way to get Midori to auto-enter these details and enter?
We're using the instructions here - https://github.com/MobilityLab/TransitS ... spberry-Pi to set-up a "web screen" that loads a webpage on boot, and nothing else.
The page in question has a username/password access system. Is there a way to get Midori to auto-enter these details and enter?
Re: Auto open browser on boot
I've tried exactly this using the latest Raspbian from noobs, nothing happened. Do I need to set it to boot into command line because mine boots into the GUI automaticallySuper-Nathan wrote:Frankly your best bet would be to install openbox and have openbox open the bowser for you. this would give you a fullscreen webbrowser with NOTHING else. no statusbar, no time, no startmenu, nothing but the browser.
and then make a openbox config file withCode: Select all
sudo aptitude install openbox obconf obmenu
Then edit the autostart to openthe browser at bootCode: Select all
mkdir -p ~/.config/openbox && cp /etc/xdg/openbox/* ~/.config/openbox
remove all the code and past this in:Code: Select all
nano ~/.config/openbox/autostart
that will make it run with fewer options auto resetting after 2 minutes inactivityCode: Select all
# Autostart script #will sleep to make sure everything else loads sleep 5s && midori --inactivity-reset=120 -e Fullscreen --app=/PATH/TO/HOMEPAGE/FILE.html
Re: Auto open browser on boot
Save your time, this method no longer works. I have yet not found any other.
Re: Auto open browser on boot
I solved using autostart of LXDE-pi and a sh file with epiphany browser.
I had to install xautomation for simulate an user input
In the home of pi I've created a sh file
I've inserted the following code in the file
I added the executable permission on the sh file with chmod command
I've modified the autostart files of LXDE-pi session
by adding the following command to run my sh file
Now our browser should be start in full screen mode at each boot
If it does not, check that the Raspberry's configuration had enabled the boot into the desktop environment
Select: 3 Enable Boot to Desktop/Scratch
Select: Desktop Log in as user 'pi' at the graphical desktop
Enjoy
I had to install xautomation for simulate an user input
Code: Select all
sudo aptitude install xautomation
Code: Select all
touch start_browser.sh
Code: Select all
# running the browser on the main desktop
sudo -u pi epiphany-browser -a --profile ~/.config http://www.google.com/ --display=:0 &
# waits a few seconds, we wait that the browser has started successfully
sleep 15s;
# xautomation simulates the pressure on the F11 key for activate the browser in full screen mode on the main desktop
xte "key F11" -x:0
Code: Select all
sudo chmod 755 start_browser.sh
Code: Select all
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Code: Select all
@/home/pi/start_browser.sh
If it does not, check that the Raspberry's configuration had enabled the boot into the desktop environment
Code: Select all
sudo raspi-config
Select: Desktop Log in as user 'pi' at the graphical desktop
Enjoy
Re: Auto open browser on boot
I solved using autostart of LXDE-pi and a sh file and epiphany browser.
I had to install xautomation for simulate an user input
In the home of pi I've created a sh file
I've inserted the following code in the file
I added the executable permission on the sh file with chmod command
I've modified the autostart files of LXDE-pi session
by adding the following command to run my sh file
Now our browser should be start in full screen mode at each boot
If it does not, check that the Raspberry's configuration had enabled the boot into the desktop environment
Select: 3 Enable Boot to Desktop/Scratch
Select: Desktop Log in as user 'pi' at the graphical desktop
Enjoy
I had to install xautomation for simulate an user input
Code: Select all
sudo aptitude install xautomation
Code: Select all
touch start_browser.sh
Code: Select all
# running the browser on the main desktop
sudo -u pi epiphany-browser -a --profile ~/.config http://www.google.com/ --display=:0 &
# waits a few seconds, we wait that the browser has started successfully
sleep 15s;
# xautomation simulates the pressure on the F11 key for activate the browser in full screen mode on the main desktop
xte "key F11" -x:0
Code: Select all
sudo chmod 755 start_browser.sh
Code: Select all
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Code: Select all
@/home/pi/start_browser.sh
If it does not, check that the Raspberry's configuration had enabled the boot into the desktop environment
Code: Select all
sudo raspi-config
Select: Desktop Log in as user 'pi' at the graphical desktop
Enjoy
Re: Auto open browser on boot
I tried this and after the reboot nothing happened... I am a noob so maybe there is something I did wrong?fvlgnn wrote: ↑Wed Jul 20, 2016 12:20 pmI solved using autostart of LXDE-pi and a sh file and epiphany browser.
I had to install xautomation for simulate an user input
In the home of pi I've created a sh fileCode: Select all
sudo aptitude install xautomation
I've inserted the following code in the fileCode: Select all
touch start_browser.sh
I added the executable permission on the sh file with chmod commandCode: Select all
# running the browser on the main desktop sudo -u pi epiphany-browser -a --profile ~/.config http://www.google.com/ --display=:0 & # waits a few seconds, we wait that the browser has started successfully sleep 15s; # xautomation simulates the pressure on the F11 key for activate the browser in full screen mode on the main desktop xte "key F11" -x:0
I've modified the autostart files of LXDE-pi sessionCode: Select all
sudo chmod 755 start_browser.sh
by adding the following command to run my sh fileCode: Select all
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Now our browser should be start in full screen mode at each bootCode: Select all
@/home/pi/start_browser.sh
If it does not, check that the Raspberry's configuration had enabled the boot into the desktop environment
Select: 3 Enable Boot to Desktop/ScratchCode: Select all
sudo raspi-config
Select: Desktop Log in as user 'pi' at the graphical desktop
Enjoy
Thanks!
Re: Auto open browser on boot
Yes I had the same problem and the instructions on this stack overflow page helped fix it:
https://raspberrypi.stackexchange.com/q ... e086bdccc2
In short you need to use the pi user's autostart file in order to launch chromium, not the system wide one.
https://raspberrypi.stackexchange.com/q ... e086bdccc2
In short you need to use the pi user's autostart file in order to launch chromium, not the system wide one.
-
- Posts: 5
- Joined: Tue Nov 21, 2017 3:45 pm
Re: Auto open browser on boot
Hi I am having simillar problems.
I want to autostart the application Rdesktop when the system boots but without success.
When I try to execute /etc/xdg/lxsession/LXDE-pi/autostart it says Permission Denied
I have NOOBS version 2.1 with the pi user.
Any help will be great.
Thank you
I want to autostart the application Rdesktop when the system boots but without success.
When I try to execute /etc/xdg/lxsession/LXDE-pi/autostart it says Permission Denied
I have NOOBS version 2.1 with the pi user.
Any help will be great.
Thank you
-
- Posts: 84
- Joined: Tue Nov 10, 2015 3:06 pm
Re: Auto open browser on boot
What about an if command in the .bashrc script?
Thanks
This is not like any other bulletin boards that I have been on. Been flamed on other BB's so bad I was afraid to ask.
All my Raspberry Pi's are like the Hessian artilleryman of Sleepy Hollow.
This is not like any other bulletin boards that I have been on. Been flamed on other BB's so bad I was afraid to ask.
All my Raspberry Pi's are like the Hessian artilleryman of Sleepy Hollow.
Re: Auto open browser on boot
how do i automatically open up multiple tabs?