RetroPie forum home
    • Recent
    • Tags
    • Popular
    • Home
    • Docs
    • Register
    • Login

    building on ubuntu server 16.04

    Scheduled Pinned Locked Moved Projects and Themes
    ubuntu serverautologin
    45 Posts 8 Posters 17.5k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • mituM
      mitu Global Moderator @esmith13
      last edited by mitu

      @esmith13 Have you reported this to the RetroArch devs ? Maybe providing some logs will help diagnose and fix the issue - whatever that is. Is it the same game/rom or happens with every libretro core ?

      1 Reply Last reply Reply Quote 0
      • P
        praetorian55
        last edited by

        Hi all - I'm a bit late to the party, but I learned a good deal on my quest to get an x86 retropie box on Ubuntu server.

        @damanbaird - Thanks for the writeup on the things you tried, as it saved me a ton of time!

        Anyway, I was successful in building out Ubuntu server 16.04.4 and 18.04 with both Xorg and Wayland. I settled on Wayland since it allows me to run the games in DRM/KMS mode which can help a bit with input lag.

        Where I got stuck (and it looks like where @damanbaird got stuck as well) was getting emulationstation to launch, which requires X. I tried the recommendations I saw in the various kiosk tutorials mentioned above and ran into the same problem - It appeared as though emulationstation could not find X or the input drivers.

        The key I found was to run a window manager that allows for an autorun. This allows X to load fully and then the window manager launches emulationstation without issue.

        Steps I followed 1-3 from @damanbaird's writeup, plus:

        1. Once openbox is installed, create and edit ~/.config/openbox/autostart

          gnome-terminal --full-screen --hide-menubar -e emulationstation 
          

        (Running emulationstation under a terminal emulator allows the runcommand program to shell out and retroarch)

        1. Edit (or create and edit) the ~/.xsession file

          exec openbox-session
          
        2. Edit (or create and edit) the ~/.bash_profile file:

          if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then
            startx
          fi
          
        3. edit /etc/systemd/system/getty@tty1.service.d/override.conf

          [Service]
          ExecStart=
          ExecStart=-/sbin/agetty --noissue --autologin username %I $TERM
          Type=idle
          

        With that I got exactly what I wanted, an x86 ubuntu server build that loads right into Emulationstation with full functionality. (The one other thing you'll probably want to do is to enable your retropie account to sudo without a password)

        The setup for wayland is a bit different but similar - I was able to use the .15.2 version of the swaywm and configure it similarly to openbox's autorun

        P johnodonJ 3 Replies Last reply Reply Quote 0
        • P
          praetorian55 @praetorian55
          last edited by

          I had a few more notes to help make it pretty:

          SET OPENBOX BACKGROUND TO BLACK
          ---edit openbox autostart file
          ---used script example below from https://bbs.archlinux.org/viewtopic.php?id=226139
          ---set to black before calling emulationstation
          -------->setting it after causes gray -> black transition

          SET A BACKGROUND COLOR

              BG=""
              if which hsetroot >/dev/null 2>/dev/null; then
                BG=hsetroot
              elif which esetroot >/dev/null 2>/dev/null; then
                BG=esetroot
              elif which xsetroot >/dev/null 2>/dev/null; then
               BG=xsetroot
              fi
              test -z $BG || $BG -solid "#000000"
          

          CHANGE GNOME-TERMINAL BACKGROUND
          --open gnome terminal in openbox
          --go to profile preferences and set color
          --go to profile preferences and uncheck scrollbar in "Scroll" area

          1 Reply Last reply Reply Quote 0
          • johnodonJ
            johnodon @praetorian55
            last edited by johnodon

            EDIT: I found an article that shows the same and instructs to create the '/etc/systemd/system/getty@tty1.service.d' folder. Trying that now.
            EDIT#2: Confirmed. Both the 'getty@tty1.service.d' folder and 'override.conf' file need to be created.

            @praetorian55 said in building on ubuntu server 16.04:

            1. edit /etc/systemd/system/getty@tty1.service.d/override.conf

              [Service]
              ExecStart=
              ExecStart=-/sbin/agetty --noissue --autologin username %I $TERM
              Type=idle
              

            Is this part correct? That path does not exist for me on Ubuntu Server 16.04.

            1 Reply Last reply Reply Quote 0
            • johnodonJ
              johnodon
              last edited by johnodon

              UPDATE: I was able to get rid of the two errors below (menu file and dbus-launch) by installing 'menu' and 'dbus-x11.

              OK. @praetorian55 I performed the first 3 steps of @damanbaird 's post followed by your steps. Server is auto-logging in but all I get is a black screen with the mouse pointer.

              FYI...not sure if it helps but I see this in the ~.xsession-errors file:

              Xsession: X session started for pi at Sat Jul 28 08:37:17 EDT 2018
              localuser:pi being added to access control list
              Openbox-Message: Unable to find a valid menu file "/var/lib/openbox/debian-menu.xml"
              Error constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Failed to execute child process "dbus-launch" (No such file or directory)
              Failed to launch bus: Failed to connect to session busError constructing proxy for org.gnome.Terminal:/org/gnome/Terminal/Factory0: Failed to execute child process "dbus-launch" (No such file or $
              Failure: Module initialization failed

              Any ideas?

              TIA!

              John

              1 Reply Last reply Reply Quote 0
              • johnodonJ
                johnodon
                last edited by johnodon

                ...

                1 Reply Last reply Reply Quote 0
                • johnodonJ
                  johnodon
                  last edited by johnodon

                  ...

                  1 Reply Last reply Reply Quote 0
                  • johnodonJ
                    johnodon
                    last edited by johnodon

                    I now have ES starting as expected. I am on to adding roms and testing RA and controls.

                    FYI...I am capturing the things I had to do to get this all to work (at least for me) and I will post a comprehensive guide.

                    John

                    1 Reply Last reply Reply Quote 0
                    • johnodonJ
                      johnodon
                      last edited by johnodon

                      Added a few roms and vids play nice...no need for OMX since my laptop has accelerated HW. However, there is no sound. I'm guessing I will need to play with pulseaudio a bit.

                      Also, RA is having issues. It either launches to a black screen, or, starts to load the rom (ROM checks) and freezes.

                      I'll continue to play.

                      mituM 1 Reply Last reply Reply Quote 0
                      • mituM
                        mitu Global Moderator @johnodon
                        last edited by

                        @johnodon said in building on ubuntu server 16.04:

                        Also, RA is having issues. It eitehr launches to a black screen, or, starts to load the rom (ROM checks) and freezes.

                        Use the Configuration Editor and set the video_threaded configuration to false for all Libretro cores. This should solve the video issue.

                        johnodonJ 1 Reply Last reply Reply Quote 0
                        • johnodonJ
                          johnodon @mitu
                          last edited by

                          @mitu said in building on ubuntu server 16.04:

                          @johnodon said in building on ubuntu server 16.04:

                          Also, RA is having issues. It eitehr launches to a black screen, or, starts to load the rom (ROM checks) and freezes.

                          Use the Configuration Editor and set the video_threaded configuration to false for all Libretro cores. This should solve the video issue.

                          Thanks @mitu but the choppy vids I was referring to are the video previews in ES. Wouldn't this change only be for gameplay using RA?

                          mituM 1 Reply Last reply Reply Quote 0
                          • mituM
                            mitu Global Moderator @johnodon
                            last edited by

                            @johnodon My advice only refers to the problem you mentioned about RA:

                            Also, RA is having issues. It eitehr launches to a black screen, or, starts to load the rom (ROM checks) and freezes.

                            You mentioned that the video previews are ok

                            Added a few roms and vids play nice...no need for OMX since my laptop has accelerated HW

                            1 Reply Last reply Reply Quote 0
                            • johnodonJ
                              johnodon
                              last edited by johnodon

                              @mitu Sorry if I wasn't clear or misunderstood.

                              OK. So turning off video threading in RA may fix the issue of RA crashing or freezing? I wasn't aware...thank you for that. I'll give it a try.

                              Yes, vid previews are running much better on x86 (really one of the main reasons I want to get this to work).

                              1 Reply Last reply Reply Quote 0
                              • johnodonJ
                                johnodon
                                last edited by

                                Sound is now working in ES and RA. I had to install 'alsa-base' so I could launch alsamixer to unmute Master and Speaker.

                                I have also successfully tested Zaxxon and Battletoads (mame2003) and Metal Slug (fbalpha).

                                @mitu On this latest attempt I did not set video threading to false. I'm actually wondering if the issue may have been on folder permissions...meaning RA was not able to write to the mame2003 or fba subfolders (I use the arcade folder). I ran 'resetromdirs' in Configuration/Tools and everything is working as expected so far.

                                The last thing to do is just cleanup...change background color of the terminal window, etc. So far this is running exactly as I wanted.

                                1 Reply Last reply Reply Quote 0
                                • johnodonJ
                                  johnodon
                                  last edited by johnodon

                                  First, I would like to sincerely thank the contributors of this thread for getting me to this point!

                                  As promised, he is MY step-by-step to get this working.

                                  Disclaimer...

                                  • I tested ONLY on Ubuntu Server 17.10.1.
                                  • I tested ONLY lr-mame2003, lr-mame2003-plus and lr-fbalpha.
                                  • I tested ONLY from the 'arcade' folder.
                                  • I did not test HDMI or external controls as my testbed is a laptop.

                                  Now, on to the meat...

                                  1. Install Ubuntu Server 17.10.1
                                    a. I performed a VERY vanilla install
                                    b. I used pi/raspberry for user/password so I can transfer settings easily from a Pi install
                                    c. I install only the openssh server package

                                  I perform all steps below in a remote SSH session so I can copy/paste. NOTE: You will need to provide your password for the first command. After reboot it will no longer be required.
                                  2. Add the 'pi' user to sudoers

                                  sudo sed -i -e '$a\pi ALL=(ALL) NOPASSWD:ALL' /etc/sudoers
                                  
                                  1. Update/Upgrade Ubuntu
                                  sudo apt-get update -y && sudo apt-get upgrade -y
                                  
                                  1. Install dependencies
                                  sudo apt-get install xorg openbox pulseaudio alsa-utils python-xdg at-spi2-core menu dbus-x11 git dialog unzip xmlstarlet --no-install-recommends -y
                                  
                                  1. Get the Retropie Setup script
                                  git clone --depth=1 https://github.com/RetroPie/RetroPie-Setup.git
                                  
                                  1. Configure Openbox
                                  mkdir ~/.config && mkdir ~/.config/openbox && echo 'gnome-terminal --full-screen --hide-menubar -- emulationstation' >> ~/.config/openbox/autostart
                                  
                                  1. Create a xsession for Openbox
                                  echo 'exec openbox-session' >> ~/.xsession
                                  
                                  1. Create a bash profile
                                  echo 'if [[ -z $DISPLAY ]] && [[ $(tty) = /dev/tty1 ]]; then' >> ~/.bash_profile && sed -i '$ a\  startx' ~/.bash_profile && sed -i '$ a\fi' ~/.bash_profile
                                  
                                  1. Enable autologin for 'pi' user
                                  sudo mkdir /etc/systemd/system/getty@tty1.service.d && sudo sh -c 'echo [Service] >> /etc/systemd/system/getty@tty1.service.d/override.conf' && sudo sed -i '$ a\ExecStart=' /etc/systemd/system/getty@tty1.service.d/override.conf && sudo sed -i '$ a\ExecStart=-/sbin/agetty --noissue --autologin pi %I $TERM' /etc/systemd/system/getty@tty1.service.d/override.conf && sudo sed -i '$ a\Type=idle' /etc/systemd/system/getty@tty1.service.d/override.conf
                                  
                                  1. Start the Retropie Setup script
                                  sudo RetroPie-Setup/retropie_setup.sh
                                  
                                  1. OK at the Retropie Setup script disclaimer

                                  NOTE: All steps below assume that you are at the main Retropie Setup screen

                                  1. Basic install >> Yes

                                  2. Configuration / Tools >> samba >> Install Retropie Samba shares

                                  3. Configuration / Tools >> resetromdirs

                                  4. Perform reboot

                                  At this point you should be able to test some roms to make sure everything is running as expected.

                                  • If you are having issues with EMUs freezing/hanging or getting a black screen, try running 'resetromdirs' from the Configutation / Tools section of the Retropie Setup script. This has worked for me as I think it was a permissions issue when trying to write to the configuration folders. (just a hunch)

                                  If you are not getting any sound in ES or RA, run alsamixer and unmute channels

                                  alsamixer
                                  
                                  1. Press F6 to select the correct sound card (if not already selected)
                                  2. Use the arrow keys to move left/right
                                  3. Press the M key to mute (MM) or unmute (##) the selected channel
                                  4. Use the arrow keys to move the volume slider up/down
                                  5. Press the ESC key to exit

                                  If you are not getting sound in ES or RA via HDMI, you may need to make HDMI your default device for Pulseaudio:

                                  1. Get full list of pulseaudio properties:
                                  pacmd list
                                  
                                  1. Scroll to bottom and look for Profiles (active profile is shown in blue below):

                                  profiles:
                                  input:analog-stereo: Analog Stereo Input (priority 60, available: no)
                                  output:analog-stereo: Analog Stereo Output (priority 6000, available: unknown)
                                  output:analog-stereo+input:analog-stereo: Analog Stereo Duplex (priority 6060, available: unknown)
                                  output:hdmi-stereo: Digital Stereo (HDMI) Output (priority 5400, available: unknown)
                                  output:hdmi-stereo+input:analog-stereo: Digital Stereo (HDMI) Output + Analog Stereo Input (priority 5460, available: unknown)
                                  output:hdmi-surround: Digital Surround 5.1 (HDMI) Output (priority 300, available: unknown)
                                  output:hdmi-surround+input:analog-stereo: Digital Surround 5.1 (HDMI) Output + Analog Stereo Input (priority 360, available: unknown)
                                  output:hdmi-surround71: Digital Surround 7.1 (HDMI) Output (priority 300, available: unknown)
                                  output:hdmi-surround71+input:analog-stereo: Digital Surround 7.1 (HDMI) Output + Analog Stereo Input (priority 360, available: unknown)
                                  off: Off (priority 0, available: unknown)
                                  active profile: output:analog-stereo+input:analog-stereo

                                  1. Decide which is the proper profile to use (for me it is 'output:hdmi-stereo+input:analog-stereo')
                                  2. Run the following command tailored for your profile:
                                  sudo sed -i -e '$ a\set-card-profile 0 output:hdmi-stereo+input:analog-stereo' /etc/pulse/default.pa
                                  
                                  1. Reboot and test
                                  sudo reboot
                                  

                                  Additional tasks...

                                  Make the terminal window "invisible"

                                  1. ALT+TAB to the 'Terminal' window.
                                  2. Right click anywhere on it and select Profiles >> Profile Preferences.
                                  3. Go to the Colors tab and uncheck 'Use colors from system theme'.
                                  4. Set the Default color for Text and Background to black for each.
                                  5. Go to the Scrolling tab and uncheck 'Show scrollbar'.
                                  6. Click the 'Close' button and ALT+TAB back to the ES screen.
                                  7. Launch a rom to see how it looks.

                                  Any/all feedback is welcome!

                                  John

                                  Used2BeRXU 1 Reply Last reply Reply Quote 1
                                  • johnodonJ
                                    johnodon @praetorian55
                                    last edited by

                                    @praetorian55 said in building on ubuntu server 16.04:

                                    1. Once openbox is installed, create and edit ~/.config/openbox/autostart

                                    How are you installing openbox on 18.04? When I try using apt-get, there is no package:

                                    E: Package 'openbox' has no installation candidate

                                    John

                                    mituM BuZzB 2 Replies Last reply Reply Quote 0
                                    • mituM
                                      mitu Global Moderator @johnodon
                                      last edited by

                                      @johnodon said in building on ubuntu server 16.04:

                                      How are you installing openbox on 18.04?

                                      The previous post mentions 17.10, not 18.04. But it's also available in Bionic - https://packages.ubuntu.com/bionic/openbox.

                                      johnodonJ 1 Reply Last reply Reply Quote 0
                                      • BuZzB
                                        BuZz administrators @johnodon
                                        last edited by BuZz

                                        @johnodon either you haven't done apt-get update or you are missing some repositories that come with 18.04

                                        To help us help you - please make sure you read the sticky topics before posting - https://retropie.org.uk/forum/topic/3/read-this-first

                                        johnodonJ 1 Reply Last reply Reply Quote 0
                                        • johnodonJ
                                          johnodon @mitu
                                          last edited by

                                          @mitu said in building on ubuntu server 16.04:

                                          @johnodon said in building on ubuntu server 16.04:

                                          How are you installing openbox on 18.04?

                                          The previous post mentions 17.10, not 18.04. But it's also available in Bionic - https://packages.ubuntu.com/bionic/openbox.

                                          @praetorian55 does mention 18.04 in his testing.

                                          "Anyway, I was successful in building out Ubuntu server 16.04.4 and 18.04 with both Xorg and Wayland."

                                          1 Reply Last reply Reply Quote 0
                                          • johnodonJ
                                            johnodon @BuZz
                                            last edited by johnodon

                                            @buzz said in building on ubuntu server 16.04:

                                            @johnodon either you haven't done apt-get update or you are missing some repositories that come with 18.04

                                            EDIT: I'll admit that this was my first exposure to the new installer. I pretty much just 'continued' through each screen and did not select any of the predefined packages that are available. Could this be the issue?

                                            I have now tried 3 different builds on 2 different pieces of hardware and each has told me that openbox is not available in the repos. I always do an apt-get update prior to trying to install from the repos. I don't know what to make of it.

                                            Following the same exact process listed above, I do not have the issue on 16.04 or 17.10.

                                            FYI...it also tells me that 'menu', 'dbus-x11' and 'dialog' are not available.

                                            mituM 1 Reply Last reply Reply Quote 0
                                            • First post
                                              Last post

                                            Contributions to the project are always appreciated, so if you would like to support us with a donation you can do so here.

                                            Hosting provided by Mythic-Beasts. See the Hosting Information page for more information.