element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Single-Board Computers
  • Products
  • Dev Tools
  • Single-Board Computers
  • More
  • Cancel
Single-Board Computers
Forum can not auto startup chromium(chromium-ozone-wayland)
  • Blog
  • Forum
  • Documents
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Single-Board Computers requires membership for participation - click to join
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 4 replies
  • Subscribers 58 subscribers
  • Views 2113 views
  • Users 0 members are here
Related

can not auto startup chromium(chromium-ozone-wayland)

gonewtinwind
gonewtinwind over 4 years ago

hi all,

I am playing imx8qm maaxboard board

I have added

chromium.service  at /etc/systemd/system/chromium.service

and make a link at /etc/systemd/system/multi-user.target.wants/chromium.service

it can run ExecStart=/bin/touch /aa.txt

after startup , I can find /aa.txt generated, it means the chromium.service running

but chromium not running.

anyway, I can manaully start up  chromium after log in

Why can not auto startup chromium ?

 

any help?

thank you.

 

my chromium.service file:

[Unit]

Description=launch chromium

[Service]

Type=oneshot

ExecStart=/bin/touch /aa.txt

ExecStart=/bin/sleep 20

ExecStart=/usr/bin/chromium  --no-sandbox --gpu-no-context-lost --enable-gpu-rasterization --start-fullscreen --kiosk --no-first-run --incognito http://localhost:3300/rpi.html > /dev/null 2>&1 &

[Install]

WantedBy=multi-user.target

  • Sign in to reply
  • Cancel

Top Replies

  • jafoste4
    jafoste4 over 4 years ago +1
    Hi, Try referencing these links. https://raspberrypi.stackexchange.com/questions/101733/raspberry-pi-4-autostart-chromium https://raspberrypi.stackexchange.com/questions/38515/auto-start-chromium-on-raspbian…
  • gonewtinwind
    gonewtinwind over 4 years ago in reply to jafoste4 +1
    I have find the solution. it's hard to do in systemd(maybe it's new for me): 1. create environmen file chromium first: cat /etc/default/chromium #OPTARGS="--xwayland --use-g2d=1" XDG_RUNTIME_DIR="/run…
  • jafoste4
    jafoste4 over 4 years ago

    Hi,

     

    Try referencing these links.

    https://raspberrypi.stackexchange.com/questions/101733/raspberry-pi-4-autostart-chromium

    https://raspberrypi.stackexchange.com/questions/38515/auto-start-chromium-on-raspbian-jessie-11-2015

    https://raspberrypi.stackexchange.com/questions/15475/run-bash-script-on-startup

     

    Let me know if you have any success.

     

    Thanks,
    Josh

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • gonewtinwind
    gonewtinwind over 4 years ago in reply to jafoste4

    I have find the solution. it's hard to do in systemd(maybe it's new for me):

    1. create environmen file chromium first:

    cat /etc/default/chromium
    #OPTARGS="--xwayland --use-g2d=1"

    XDG_RUNTIME_DIR="/run/user/0"

    2. create a chromium.service file at /etc/systemd/system/chromium.service , put in the environmen file   like following:

    [Unit]
    Description=launch chromium

    [Service]
    User=root

    Type=oneshot

    ExecStart=/bin/sleep 20

    EnvironmentFile=-/etc/default/chromium
    ExecStart=/usr/bin/chromium --no-sandbox --gpu-no-context-lost --enable-gpu-rasterization --start-fullscreen --kiosk --no-first-run --incognito http://localhost:3300/rpi.html > /dev/null 2>&1 &


    [Install]
    WantedBy=multi-user.target

     

    3. run: systemctl enable chromium or

    directly make a symbol link at :

    /etc/systemd/system/multi-user.target.wants/chromium.service -> /etc/systemd/system/chromium.service

     

    at  /etc/systemd/system/multi-user.target.wants/. to run ln -s  chromium.service  ../chromium.service  to make this link

     

    .

    try to run systemctl start chromium to test. works well.

    power off and power on or restart . work well.

    done

     

    Thank you

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • vmate
    vmate over 4 years ago

    First, you should set the User option to your user to avoid running chromium as root, then set WantedBy to your DE's .target.

    Probably a better option would be to use your DE's autostart feature, made for this exact purpose of starting GUI programso on boot

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • gonewtinwind
    gonewtinwind over 4 years ago in reply to vmate

    hi @Mate Varga,

    how to avoid running chromium as root? I tried my time to run as myuser, eg:

     

    ExecStart=sudo -u myuser /usr/bin/chromium  --gpu-no-context-lost --enable-gpu-rasterization --start-fullscreen --kiosk --no-first-run --incognito http://localhost:3300/rpi.html > /dev/null 2>&1 &

     

     

    but can not be successful. so I have to use root user.

    how to write the chromium.service?

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube