element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • 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
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Running Headless from GUI
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • Replies 5 replies
  • Subscribers 666 subscribers
  • Views 1076 views
  • Users 0 members are here
Related

Running Headless from GUI

waelect
waelect over 7 years ago

Hi,

 

I am fairly new to Raspberry Pi and have been working on a project for a while using GUI. I am now finished the GUI learning process but without starting from scratch is it possible to change to headless operation from the current GUI format with minimal fuss.

 

Is there a link to describe this or do I have to start fresh?

 

Starting fresh I can do but trying to short cut the exercise. I have a RPi 3

 

Cheers

 

Malcolm

  • Sign in to reply
  • Cancel
Parents
  • shabaz
    shabaz over 7 years ago

    Hi Malcolm,

     

    If you mean the GUI needs to run on a remote machine, there are a few ways if you don't want to change your existing app, for example by running an X server, or using some remote desktop software such as VNC or Windows Remote Desktop (the latter is described here: Accessing and Controlling the Pi  ). If the GUI runs as a browser based app then that can be accessed remotely too.

    If you mean running the app remotely without any remote display either, i.e. no GUI at all, then that's not normally possible unless the app provides for a way to interface using (say) command line (CLI) or some other interface, serial or HTTP for example. If it is an app for which you have the source code, you could try to add to it, to enable (say) a command line interface to it too.

    One example is (say) you've written some code to flash some lights according to a pattern selected via a GUI. If you add a command line parameter, then when the application runs, it can check if the parameter is there, and not invoke the GUI in that case, but take its input from the command line instead. The parameter could be (say) the sequence of lights that need flashing, e.g.

    myledprog --sequence 111222112212123

    or (say)

    myledprog --seqfile pattern1.txt

     

    Depending on the language your program is written it, it could be easy to check for parameters when the program is called. In C it is straightforward for instance.

    Anyway, this is just an idea.. as mentioned, I'm not sure if you meant you still wished the GUI to run but on a remote screen.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Reply
  • shabaz
    shabaz over 7 years ago

    Hi Malcolm,

     

    If you mean the GUI needs to run on a remote machine, there are a few ways if you don't want to change your existing app, for example by running an X server, or using some remote desktop software such as VNC or Windows Remote Desktop (the latter is described here: Accessing and Controlling the Pi  ). If the GUI runs as a browser based app then that can be accessed remotely too.

    If you mean running the app remotely without any remote display either, i.e. no GUI at all, then that's not normally possible unless the app provides for a way to interface using (say) command line (CLI) or some other interface, serial or HTTP for example. If it is an app for which you have the source code, you could try to add to it, to enable (say) a command line interface to it too.

    One example is (say) you've written some code to flash some lights according to a pattern selected via a GUI. If you add a command line parameter, then when the application runs, it can check if the parameter is there, and not invoke the GUI in that case, but take its input from the command line instead. The parameter could be (say) the sequence of lights that need flashing, e.g.

    myledprog --sequence 111222112212123

    or (say)

    myledprog --seqfile pattern1.txt

     

    Depending on the language your program is written it, it could be easy to check for parameters when the program is called. In C it is straightforward for instance.

    Anyway, this is just an idea.. as mentioned, I'm not sure if you meant you still wished the GUI to run but on a remote screen.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
Children
  • waelect
    waelect over 7 years ago in reply to shabaz

    Mostly i want to test the power consumption difference removing the GUI. Fortunately most of the application should work without the GUI running. Anyway VNC Server is easy to use, I have no problems using that but each GUI operation draws more power from the system and I need to reduce power consumption as much as possible.

     

    All the apps are Python based and can work on a headless system. I just don't want to completely re-install and re-configure a lite system.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • Cancel
  • gecoz
    gecoz over 7 years ago in reply to waelect

    Hi Malcolm,

     

    You can try by brutally removing all the X11 components from the system, that would definitely remove all the GUI components. You just need to make sure none of your applications use any X11 library, otherwise they will fail (even if they don't use graphics, sometimes applications use X11 functions for other reasons... it is bad practice but it happens)

     

    To uninstall, just issue:

     

    sudo apt-get remove --purge x11-*
    sudo apt-get autoremove

     

    I hope it helps.

     

    Fabio

    • Cancel
    • Vote Up +1 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