Hey folks, there is a new Podcast category for forums https://forums.plex.tv/categories/podcasts
If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Start automatically Plex at Mac OS (High Sierra) startup

Hello, is there any easy way to make Plex Media Server start automagically when someone turn on my Mac so I don't need to be present and login to start it ?
I have already read a lot on it and tried several "solutions" but none seems working ...

«1

Answers

  • nigelpbnigelpb Posts: 1,154Members, Plex Pass Plex Pass
    edited March 9

    @jrcorwin said:

    @yves.dandoy@gmail.com said:
    Hello, is there any easy way to make Plex Media Server start automagically when someone turn on my Mac so I don't need to be present and login to start it ?
    I have already read a lot on it and tried several "solutions" but none seems working ...

    Just add it to your login items via the macOS settings.

    That's a good answer unfortunately it's not the answer to the OP's question. The question the OP asked (& why I found this thread) is "is there any easy way to make Plex Media Server start automagically when someone turn on my Mac so I don't need to be present and login to start it?" i.e. is there a way of starting Plex Media Server at boot time & without user intervention e.g. restart after a power outage.

  • SE56SE56 Posts: 2,290Members, Plex Pass Plex Pass

    If Login is an issue then on the Web app.

    It will change after every update, so you might be best to set server to "ask" for updates.

    I believe this option is available on all players and apps

    TV:(1). LG 65UB950T UHD Smart TV WebOS 1.4, (2). Hisense 50K3300UW.Receiver Onkyo TX-NR646 Network Receiver, ARC configured. Server: iMac Late 2015, 32Gb Ram, 3.2GHz Intel i5 Skylake processors.Storage: 3 WD External USB3 HDD. Devices: 2 iPad Air 2 connected with AC Wifi Dual Band. Network: Gigabite Ethernet hardwired , 5 outlets with Cat 6 and 2 Ethernet switches, Full Duplex, AVB mode enabled Remotes: Onkyo ios app, Plex ios, LG Magic remote.Speakers: Bowers and Wilkins Floor Standing Fronts and Mordaunt-Short Genie, Centre, 200W Powered Sub & 4 Satellite Surrounds. Configured for 7.1 Channels.

  • SE56SE56 Posts: 2,290Members, Plex Pass Plex Pass
    edited March 10

    Now if you want the Browser to launch at login and Plex open. You will need to do the following.

    This will work with Safari, Firefox, Chrome.

    You will need to create a Webloc file, which is simple. If you have your Plex as a bookmark /Homepage, which is required. Drag the Favicon Plex Symbol in bookmarks to a Location that you will keep. Then add that Webloc to your Login items. You must keep the Webloc for this to work

    Bookmark required.

    To set your Mac to automatically log in during startup, follow the following support article from apple.

    https://support.apple.com/en-au/HT201476

    Example:

    Plex Media server will also have to added to Log in items in System Preferences.

    To be Clear I have this set up and it works in High Sierra with a restart,shutdown or power outage/Failure.

    Finally to make it work with a power failure or outage you will need to do the following.

    TV:(1). LG 65UB950T UHD Smart TV WebOS 1.4, (2). Hisense 50K3300UW.Receiver Onkyo TX-NR646 Network Receiver, ARC configured. Server: iMac Late 2015, 32Gb Ram, 3.2GHz Intel i5 Skylake processors.Storage: 3 WD External USB3 HDD. Devices: 2 iPad Air 2 connected with AC Wifi Dual Band. Network: Gigabite Ethernet hardwired , 5 outlets with Cat 6 and 2 Ethernet switches, Full Duplex, AVB mode enabled Remotes: Onkyo ios app, Plex ios, LG Magic remote.Speakers: Bowers and Wilkins Floor Standing Fronts and Mordaunt-Short Genie, Centre, 200W Powered Sub & 4 Satellite Surrounds. Configured for 7.1 Channels.

  • SE56SE56 Posts: 2,290Members, Plex Pass Plex Pass
    edited March 9

    I have tested this and it works well. Now if you have sensitive data on this Mac you will need to look at securing your data with password or using a Fault.

    A reference Page on the subject.

    https://mac-how-to.gadgethacks.com/how-to/ultimate-guide-password-protecting-files-folders-mac-os-x-yosemite-0160423/

    TV:(1). LG 65UB950T UHD Smart TV WebOS 1.4, (2). Hisense 50K3300UW.Receiver Onkyo TX-NR646 Network Receiver, ARC configured. Server: iMac Late 2015, 32Gb Ram, 3.2GHz Intel i5 Skylake processors.Storage: 3 WD External USB3 HDD. Devices: 2 iPad Air 2 connected with AC Wifi Dual Band. Network: Gigabite Ethernet hardwired , 5 outlets with Cat 6 and 2 Ethernet switches, Full Duplex, AVB mode enabled Remotes: Onkyo ios app, Plex ios, LG Magic remote.Speakers: Bowers and Wilkins Floor Standing Fronts and Mordaunt-Short Genie, Centre, 200W Powered Sub & 4 Satellite Surrounds. Configured for 7.1 Channels.

  • nigelpbnigelpb Posts: 1,154Members, Plex Pass Plex Pass

    @SE56 Close, but no cigar. That's a better answer & does kinda work if you ignore the whole security & logged in user thing.

    What I was looking for was something akin to the way it's handled in Linux with PMS started as a service in the background using systemd. The equivalent of systemd in OSX/MacOS is launchd. I finally found this post which looks like it does exactly what I want & really is the way that Plex Media SERVER should run in in any case i.e. as a service not requiring a logged in interactive user
    https://forums.plex.tv/discussion/comment/1604140/#Comment_1604140

  • SE56SE56 Posts: 2,290Members, Plex Pass Plex Pass

    Ok, sad it could not be disclosed exactly what was required by a secondary poster in this discussion that i was not addressing. To be said I don't smoke anyway, keep your cigar as it objectionable . As for security it can still be obtained

    TV:(1). LG 65UB950T UHD Smart TV WebOS 1.4, (2). Hisense 50K3300UW.Receiver Onkyo TX-NR646 Network Receiver, ARC configured. Server: iMac Late 2015, 32Gb Ram, 3.2GHz Intel i5 Skylake processors.Storage: 3 WD External USB3 HDD. Devices: 2 iPad Air 2 connected with AC Wifi Dual Band. Network: Gigabite Ethernet hardwired , 5 outlets with Cat 6 and 2 Ethernet switches, Full Duplex, AVB mode enabled Remotes: Onkyo ios app, Plex ios, LG Magic remote.Speakers: Bowers and Wilkins Floor Standing Fronts and Mordaunt-Short Genie, Centre, 200W Powered Sub & 4 Satellite Surrounds. Configured for 7.1 Channels.

  • nigelpbnigelpb Posts: 1,154Members, Plex Pass Plex Pass
    edited March 13

    @SE56 said:
    Ok, sad it could not be disclosed exactly what was required by a secondary poster in this discussion that i was not addressing. To be said I don't smoke anyway, keep your cigar as it objectionable . As for security it can still be obtained

    Thanks for putting in the effort to include screen shots in your reply I do appreciate the effort. It isn't however actually necessary to start a web browser. For your solution to work you just need to start PMS then click the "Open at login" selection then setup autologon for your user. Security-wise the simplest fix is to set a 1m timeout on the screensaver & an immediate lock screen timeout.

    Perhaps before getting all snippy you should read my second paragraph where I explicitly state what is required?

    I have now tried starting PMS as a service with a launch daemon but unfortunately it doesn't work as PMS on Mac evidently requires a logged in user with a desktop.

    I am just about to investigate running PMS in a docker container which will I think provide the solution as basically it's the Linux version of PMS running in a very lightweight virtual machine.

  • nigelpbnigelpb Posts: 1,154Members, Plex Pass Plex Pass

    OK I just looked at Docker & that doesn’t work either.

    Docker for Mac also requires a user to be logged in with a desktop as the GUI based “Docker.app needs to be run before any Docker commands can be issued in terminal.

    It seems like the only way that PMS can be run without a user login & desktop is to run a full blown Linux VM & then run PMS inside that. TBH I’m not sure it’s worth the effort so I may as well just install Linux natively & be done with it.

  • davidahndavidahn Posts: 16Members, Plex Pass Plex Pass
    edited April 6

    So I've read multiple threads on this topic, none of which ends in a definitive solution and a lot of frustration that the dev team won't support running PMS on macOS as a service/daemon.

    Today I found another interesting solution for auto login while maintaining security: using a loginhook to auto login and immediately go back to the login screen without displaying the desktop.

    https://www.engadget.com/2011/03/07/terminally-geeky-use-automatic-login-more-securely/

    Sadly, the article was published in 2011 so most of the image links are dead and the downloadable script is dead. And this is a bit outside my wheelhouse. Does anyone know how to get this to work?

    I've also found a potential tool called Lingon that might be able to do this, but again, I'm not nerdy enough to know where to start.

    I set up a separate macOS user called "Plex Server" with standard privileges
    I imagine having the iMac set to restart on power failure and the "Plex Server" account auto-login
    Using the above loginhook, immediately upon auto-login, the iMac goes straight to the login screen
    Plex Server account stays logged in, serving up all my pristine digital files

    I imagine the media files would best be copied while logged in as "Plex Server" in directories created by the same user account in order to avoid permissions issues in its operations.

    PMS: 27" Retina iMac 2017 (Quad Core i7 4.2 GHz) 40GB RAM · 512GB SSD
    Storage: SoftRAID RAID 5 · Oyen Digital Mobius Thunderbolt 2 case · 5 x 3 TB WD Black
    Ripping: 2 External 4K Friendly burners: LG WH16NS40 · Asus BW-16D1HT
    Playback: 4K Apple TV · Plex Media Player / Infuse Pro 5

  • nigelpbnigelpb Posts: 1,154Members, Plex Pass Plex Pass

    I eventually gave up on trying to do this with Mac natively & now run PMS in a VMware Fusion VM & have a script to start the VM when the Mac boots.

  • davidahndavidahn Posts: 16Members, Plex Pass Plex Pass

    @nigelpb said:
    I eventually gave up on trying to do this with Mac natively & now run PMS in a VMware Fusion VM & have a script to start the VM when the Mac boots.

    I'm missing the benefit of that method. So auto-login to your macOS account, then run Windows or Linux in a VM? Doesn't that add another layer of complication without solving the security issue of auto-login?

    I know some have mentioned auto screen lock after 1 minute, but that's a window of time in which someone could mess with your Mac. I suppose on a headless Mac auto-login with 1 minute lock would work, but I have an iMac so VERY not headless.

    Also has anyone recently verified that PMS WON'T run with the screen locked? I have yet to experiment with this. Away from home now, will probably try tonight.

    I feel like short of PMS running as a daemon, the next best thing would be running a script that would immediately lock the screen on boot (but not on regular logins - obviously you would never be able to use the Plex account if it immediately locked on login!), that would be pretty secure but also solve the issue of automatically loading PMS.

    PMS: 27" Retina iMac 2017 (Quad Core i7 4.2 GHz) 40GB RAM · 512GB SSD
    Storage: SoftRAID RAID 5 · Oyen Digital Mobius Thunderbolt 2 case · 5 x 3 TB WD Black
    Ripping: 2 External 4K Friendly burners: LG WH16NS40 · Asus BW-16D1HT
    Playback: 4K Apple TV · Plex Media Player / Infuse Pro 5

  • nigelpbnigelpb Posts: 1,154Members, Plex Pass Plex Pass

    @davidahn said:

    @nigelpb said:
    I eventually gave up on trying to do this with Mac natively & now run PMS in a VMware Fusion VM & have a script to start the VM when the Mac boots.

    I'm missing the benefit of that method. So auto-login to your macOS account, then run Windows or Linux in a VM? Doesn't that add another layer of complication without solving the security issue of auto-login?

    No. I'm not using auto-login. I use cron to run a script when the Mac boots (there are other ways of running s startup script but that's the simplest). The script starts the VM. Linux running in the VM has startup services that use rclone to mount my Google Drive & start PMS.

  • davidahndavidahn Posts: 16Members, Plex Pass Plex Pass

    @nigelpb said:
    No. I'm not using auto-login. I use cron to run a script when the Mac boots (there are other ways of running s startup script but that's the simplest). The script starts the VM. Linux running in the VM has startup services that use rclone to mount my Google Drive & start PMS.

    Fascinating. So on boot, the Mac shows the login screen and in the background a VM is running Linux?

    PMS: 27" Retina iMac 2017 (Quad Core i7 4.2 GHz) 40GB RAM · 512GB SSD
    Storage: SoftRAID RAID 5 · Oyen Digital Mobius Thunderbolt 2 case · 5 x 3 TB WD Black
    Ripping: 2 External 4K Friendly burners: LG WH16NS40 · Asus BW-16D1HT
    Playback: 4K Apple TV · Plex Media Player / Infuse Pro 5

  • nigelpbnigelpb Posts: 1,154Members, Plex Pass Plex Pass
    edited April 7

    @davidahn said:

    @nigelpb said:
    No. I'm not using auto-login. I use cron to run a script when the Mac boots (there are other ways of running s startup script but that's the simplest). The script starts the VM. Linux running in the VM has startup services that use rclone to mount my Google Drive & start PMS.

    Fascinating. So on boot, the Mac shows the login screen and in the background a VM is running Linux?

    Exactly! I use a script that runs a command of the form

      vmrun /path/to/vm nogui
    

    to start the vm. Details here on using vmrun https://tech.namshi.io/blog/2015/08/02/vmware-fusion-headless/

    The script runs at startup by putting an entry in crontab of the form

    @reboot /path/to/my/script
    

    Further info on running scripts at startup & using crontab here https://apple.stackexchange.com/questions/156288/how-to-get-shell-scripts-to-run-at-startup-on-yosemite

  • davidahndavidahn Posts: 16Members, Plex Pass Plex Pass

    You seem to have a much better handle on scripting and such than I. Do you have any idea how to get the above scenario working? Scripting the Plex Server macOS user to go straight to the login screen on initial boot, but not on actual manual login?

    PMS: 27" Retina iMac 2017 (Quad Core i7 4.2 GHz) 40GB RAM · 512GB SSD
    Storage: SoftRAID RAID 5 · Oyen Digital Mobius Thunderbolt 2 case · 5 x 3 TB WD Black
    Ripping: 2 External 4K Friendly burners: LG WH16NS40 · Asus BW-16D1HT
    Playback: 4K Apple TV · Plex Media Player / Infuse Pro 5

  • nigelpbnigelpb Posts: 1,154Members, Plex Pass Plex Pass

    @davidahn said:
    You seem to have a much better handle on scripting and such than I. Do you have any idea how to get the above scenario working? Scripting the Plex Server macOS user to go straight to the login screen on initial boot, but not on actual manual login?

    As explained several times above it is not possible to start Plex Media Server without an interactive login if running PMS natively on a Mac because of the way Plex have architected it. The only way that I have found is to run PMS in a Linux virtual machine & then using a script to start that VM when the Mac boots.

  • SE56SE56 Posts: 2,290Members, Plex Pass Plex Pass
    edited April 9

    So have you resolved this other than using a non admin account?

    TV:(1). LG 65UB950T UHD Smart TV WebOS 1.4, (2). Hisense 50K3300UW.Receiver Onkyo TX-NR646 Network Receiver, ARC configured. Server: iMac Late 2015, 32Gb Ram, 3.2GHz Intel i5 Skylake processors.Storage: 3 WD External USB3 HDD. Devices: 2 iPad Air 2 connected with AC Wifi Dual Band. Network: Gigabite Ethernet hardwired , 5 outlets with Cat 6 and 2 Ethernet switches, Full Duplex, AVB mode enabled Remotes: Onkyo ios app, Plex ios, LG Magic remote.Speakers: Bowers and Wilkins Floor Standing Fronts and Mordaunt-Short Genie, Centre, 200W Powered Sub & 4 Satellite Surrounds. Configured for 7.1 Channels.

  • JR86JR86 Posts: 42Members ✭✭
    edited April 9

    I have a special situation. I got a very cheap deal on a 2009 Macbook pro that had a really bad cracked screen. It would cost too much to replace the screen so I carefully dismantled the screen with the aluminum top casing, got rid of the wifi and camera wiring that was wrapped around the screen, and kept the base. When I set this MBP up I had every intent to use it for Plex and nothing else. Luckily everything else works good. I've got the MBP restarting every morning at 4:30am, with auto login and Plex Server opening right after. I also have the screensaver activated after 1min in addition to this setup. It's just 60 seconds of in between time for someone to attempt to login but they'd have to know the Remote Login for the computer since there is no screen attached. So, it is possible to open Plex at startup. Just my situation is unique.



  • nigelpbnigelpb Posts: 1,154Members, Plex Pass Plex Pass
    edited April 9

    I created a Ubuntu Linux VM under VMware Fusion then followed the excellent guide by @per_PLEX_ed on how to set up PMS on a VPS but adapted a little as I was setting up on a local server albeit in a Linux VM https://www.techperplexed.ga/p/index.html

    Then using Terminal on the Mac I created a symbolic link to point to the VMware Fusion command to start the VM

    sudo ln -s "/Applications/VMware Fusion.app/Contents/Library/vmrun" /usr/bin/vmrun
    

    I then created a script starVM to start up the VMware Fusion VM (you will need to edit the filename of your particular VM.

    #!/bin/sh
    
    export vmFile=/Users/nigel/Documents/Virtual\ Machines.localized/Ubuntu\ 64-bit\ Server\ 16.04.4.vmwarevm
    
    vmrun start "$vmFile" nogui
    

    Finally I put an entry into crontab using crontab -e again modify this for the filename & location of your particular script

       @reboot /Users/nigel/startVM
    

    In some ways there are advantages to running PMS in a Linux VM. Mounting Google Drive you can use plexdrive which aids with caching local data & preventing Google API bans. It's also very quick & simple to start & stop the whole VM from the command line by using the startVM script as above & a similar stopVM script.

  • SE56SE56 Posts: 2,290Members, Plex Pass Plex Pass

    That's great you have solved your query/ addition to the original discussion holder. I'm so glad the forum contributed in your success.

    TV:(1). LG 65UB950T UHD Smart TV WebOS 1.4, (2). Hisense 50K3300UW.Receiver Onkyo TX-NR646 Network Receiver, ARC configured. Server: iMac Late 2015, 32Gb Ram, 3.2GHz Intel i5 Skylake processors.Storage: 3 WD External USB3 HDD. Devices: 2 iPad Air 2 connected with AC Wifi Dual Band. Network: Gigabite Ethernet hardwired , 5 outlets with Cat 6 and 2 Ethernet switches, Full Duplex, AVB mode enabled Remotes: Onkyo ios app, Plex ios, LG Magic remote.Speakers: Bowers and Wilkins Floor Standing Fronts and Mordaunt-Short Genie, Centre, 200W Powered Sub & 4 Satellite Surrounds. Configured for 7.1 Channels.

«1
Sign In or Register to comment.