Repurposing an aging Chromebook to support security cameras
Keeping Watch
You can use an old Chromebook to anchor your security camera configuration – the first step is to set it up with Linux.
Having recently set up a new virtual machine server for my home lab, I started to consider all of the possible uses for it. One of the things that kept coming to mind was security cameras. I looked in the parts bin, where I had a few webcams and an old Acer Chromebook with 2 cores, 4GB of memory, a 32GB SSD, and a few USB-A ports, and that was exactly what I was looking for.
What I really wanted was some way to turn the gear that I had into two reliable security cameras in one location (99 percent uptime is fine; no five nines needed). I wanted two cameras pointing in different directions, which is the sort of thing you might do on the outside corner of a building or if you needed cameras pointing from the center of a hallway towards both ends. Note that you can certainly use a regular laptop or desktop system for this scenario, but what I had was a Chromebook.
To make this solution work, I needed to install Linux on the Chromebook and then install the Cockpit management tool and the motionEye security camera software. This article describes the steps for setting up my Chromebook security camera configuration.
Unleashing the x86iness of your Chromebook
To allow a Chromebook to run a typical x86 OS, you will need an x86 Chromebook from the list of supported devices at the MrChromebox.tech website [1]. Although there may be other ways to go about converting a Chromebook, MrChromebox has been very reliable in my experience, and his scripts are incredibly easy to use. Before you can convert the Chromebook to UEFI, however, you will need to remove the hardware and software write protect blocks, which might require different steps depending on the model of your Chromebook.
Have a look at the MrChromebox.tech site and see what method of hardware write protect block removal you can use on your device. Mine used a screw (Figure 1), as it was an older Acer, but I have also worked on models that used the battery block (Figure 2). Either way you will open up your device, so grab a screwdriver and get the keyboard or bottom panel off of it. Once inside, if you have a model with a write protect screw, you will notice that one of the screws holding the motherboard into the chassis looks different from all of the others. It is likely not painted or coated and probably has a wider diameter screw head on it than the others. Remove it and toss it. If you are using one of the models that mentions the CR50 battery method, you will need to either disconnect the battery or set a jumper. Have no fear: You'll be able to reconnect that battery after removing the write protect blocks, but for now, disconnect it and reassemble the Chromebook sans connected battery. You will use the power cord directly while you do the conversion. If this is the case, you will be able to safely reconnect the battery after UEFI has been installed.
Now that your device is back together and the hardware write protect block has been disabled, remove the software write protect measures, and install UEFI. Power on your Chromebook by holding the Esc, Refresh, and Power keys at the same time. Once the screen turns on, you can remove your finger from Power, but I usually keep the others held down until I get to the Recovery screen. Once at the Recovery screen, you will press Ctrl+D to put the device into Developer Mode. This process will take a few moments; once the process is completed, the system will reboot. One of the models that I did this on required a five minute waiting period, but I am not sure if that is the case for all models. Don't be surprised if your particular device behaves slightly differently. Note that each time the Chromebook boots now, it will give you a warning about Developer Mode and make you wait 30 seconds before it gets to the ChromeOS login screen. You can skip past this delay by pressing Ctrl+D when at that warning screen, but don't fret – you will only see this message once or twice before the new system is in place. Connect to your network and login normally. This is a good place to tell you that each one of these steps involves the risk of catastrophic failure, and any information that you have on your Chromebook could be lost completely, so back up your data before you begin.
Once in ChromeOS, you need to do two things: Go to the MrChromebox.tech website so that you can copy and paste commands, and open Crosh (the command shell for ChromeOS) by pressing Ctrl+Alt+T. Once you have Crosh opened, you need to enter the command shell
. At that point, you will be at the terminal and can run the UEFI script. Enter the command from the MrChromebox.tech site under Firmware Utility Script, which is as follows:
cd; curl -LO mrchromebox.tech/firmware-util.sh && sudo bash firmware-util.sh
You should view the contents of the script before you run it. It is located at the following:
https://github.com/MrChromebox/scripts
Once the script has been downloaded and run, you will be given a set of options. Select Update UEFI Full ROM Firmware. This will take you through a set of simple prompts. You will need to type I ACCEPT (Figure 3) after a warning, and you will also be prompted to back up your existing firmware to a USB device, which you must do in order to continue. Plug in the device and choose it once it has been recognized for the firmware to be written. Save the firmware somewhere safe or copy it to another location – the file is only a few megabytes in size. Backup is a fantastic feature of MrChromebox's work that I have personally used to bring a Chromebook back to factory setting using the restore function, but that is a story for another day.
You now have an x86 laptop with no operating system on it. You can install Windows on some models, though I most certainly do not recommend it (Windows 10 won't have enough space to update if you're using a 32GB model). Since ChromeOS is Linux anyway, you will have great luck running one of the many different distros on your Chromebook – EdUBudgie, for instance, runs very smoothly on the Chromebook and boots to the desktop just as fast as ChromeOS does.
OS and Software
Go to the Ubuntu [2] website and download a copy of Ubuntu Server 22.04 LTS. Put it onto a USB drive with the Rufus [3] or Etcher [4] image burning tool and boot to the installer. Note that you can get to boot options by pressing escape after powering on if need be. Although you could run a complete desktop with all of the frills and extras, I don't recommend it if you intend to use it as a security camera system. Any additional strain on the GPU would be unwelcome at best and could be downright problematic. Go ahead with a normal, standard Ubuntu server install. I am sure that you could use Debian or Alma or Alpine or even Arch or Slackware or Gentoo. I am comfortable with Ubuntu, and it gets the job done with a quick and easy install.
Once you have Ubuntu Server on the device, I recommend installing the Cockpit [5] graphical server management tool, along with the Cockpit Navigator [6] file browser add-on from 45 Drives (Figure 4). I will also add cockpit-pcp
, net-tools
, and ethtool
, as I just like to have them but they aren't required. You will want to update the OS and software (Listing 1) and then set a static IP address with Netplan.
Listing 1
Setting Up Cockpit
The steps for setting up a static IP address will vary depending on how you plan to use your device. I have mine set up in a location where I have power but no Ethernet jacks, so mine is configured with WiFi enabled. You might have something different, or you might have already set up a static IP address during installation. See the box entitled "Working in Cockpit" for a look at how I used Cockpit to set up a static IP address.
Working in Cockpit
The first step is to find the IP address of the Chromebook. Log into the Chromebook device and use the command ip a
to output the IP address. Then log out of the Chromebook locally by using the exit
command.
Go to a computer elsewhere on your network, and log in to the Chromebook by going to https://IPAddressOfChromebook:9090/. Port 9090 will take you to the Cockpit login screen. Log in to Cockpit and click on Navigator on the left of the screen. You will want to have root privileges, so enter your root password at the top of the Cockpit System screen in the space labeled Administrative Access.
Navigate to the directory called /etc/netplan/
, and find a YAML file with whatever config you specified during installation. I usually use DHCP during install and allow it to find an IP address but then change to a static IP by adding it here. I then reserve the address in my pfSense router to avoid any possible conflict later on. This part will vary some, but the Netplan config file is how I set up the address in Ubuntu Server.
My Netplan config file 00-installer-config-wifi.yaml
has the contents shown in Listing 2.
As you can see in Listing 2, my WiFi card is called wlp0s12f0
. If you do not know the name of your WiFi card, you can use the command ifconfig -a
to find it, along with your IP address. I have given the Chromebook an IP address of 192.168.5.99
and use my pfSense firewall located at 192.168.5.1
as my gateway. I am using it with the Cloudflare DNS servers at 1.1.1.1
and 1.0.0.1
.
Run the command sudo netplan apply
to test if your settings will work. If not, you will see a hint as to what's wrong. Note that YAML files need to have the spacing consistent and cannot use tabs but rather must use spaces. If you are new to this and find the command failing, I would check spacing first. Note, too, that if you change your IP address in this step, you will need to log back in using the new IP address and port 9090. The connection will appear to be stuck after applying your Netplan config, and you won't be able to complete the command.
Ideally, at this point you would remove the screen and keyboard and install the Chromebook motherboard into an enclosure made for it, but as I personally don't have a 3D printer, I continue to use the entire Chromebook. With that in mind, you will want to make a few other configuration changes so that your Chromebook screen will turn off after a few minutes and doesn't sleep when the screen is closed. This applies to many Chromebooks and laptops in general, but it might not apply to your system. To make these changes, use the Cockpit Navigator feature and edit a few other files, as follows:
- Navigate to
/etc/default/
and edit the file namedgrub
. - Find the line that says
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
and change it to sayGRUB_CMDLINE_LINUX_DEFAULT="quiet consoleblank=300"
where the 300 refers to the number of seconds until the Chromebook display will turn off. If you want to also turn off IPv6, addipv6.disable=1
to the same line, though that is optional. - Run the command
sudo update-grub
from the terminal section of Cockpit in order to make those GRUB changes persistent. - Navigate to
/etc/systemd/
and edit the file namedlogind.conf
. - Add the following lines to the end of
logind.conf
:
HandleSuspendKey=ignore
HandleHibernateKey=ignore
HandleLidSwitch=ignore
HandleLidSwitchExternalPower=ignore
HandleLidSwitchDocked=ignore
- Save the
logind.conf
file and run the commandsudo systemctl restart systemd-logind
to make those changes stick. - Reboot from the overview page or by typing
sudo reboot now
at the terminal.
Listing 2
Netplan Config File
At this point, I turned my Chromebook off and moved it to where I would permanently install it. Everything from here on can be done from Cockpit. The advantage to putting the Chromebook and cameras in place now is that, if there is a camera or USB problem in situ, you can solve it now instead of setting everything up on the bench only to find it no longer working once installed.
You can also install the webcams at this point. I used two generic and inexpensive USB webcams I bought on eBay. Any webcam that will run on Ubuntu should work. You can even use the webcam built into the Chromebook if you like. Be careful here, however; you might be tempted to buy the best thing out there, but bear in mind that your Chromebook is likely only a dual-core laptop with 4GB of memory and might not handle that 4k 60FPS Logitech beauty that costs $200. Temper your expectations and start simple. You can always try something better later if you need better quality or more resolution.
At this point, I would also reconnect the battery and make sure that the device turns on and functions normally. One of the advantages of using Chromebooks is that the battery is an in-built UPS of sorts. With the display turned off, it should power the device for a reasonable amount of time without line power. Mine will go for over four hours with two cameras on its original battery, which is nearly 10 years old.
motionEye
MotionEye is a graphical front end to the Motion daemon, a tool that monitors video signals and responds to motion detected in the video stream. I'll use motionEye as an interface for managing the security camera configuration. To install motionEye [7], follow the steps at the motionEye GitHub page. For Ubuntu 22.04, the commands are shown in Listing 3.
Listing 3
Installing motionEye
The commands in Listing 3 install motionEye using pip for Python with the configuration file in the /etc/motioneye/
directory and media in the /var/lib/motioneye/
directory. This sequence of commands also installs the necessary prerequisites and makes motionEye run as a service, so that it will automatically load on startup.
You can now open up motionEye by going to http:IPAddressYouSetEarlier:8765/. Login with the username admin
and an empty password (Figure 5). You will want to try out different settings for your cameras by tweaking the resolution, frame rate, and other parameters. You might also want to change the ports used for viewing the raw stream or choose to change the save directory or quality of the stream (Figure 6). The optimal settings will vary depending on the amount of CPU horsepower and memory you have, the amount of storage space, your security needs, and other considerations. Speaking of security, I strongly recommend you set credentials for viewing the stream.
Buy this article as PDF
(incl. VAT)
Buy Linux Magazine
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters
Support Our Work
Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.
News
-
First Release Candidate for Linux Kernel 6.14 Now Available
Linus Torvalds has officially released the first release candidate for kernel 6.14 and it includes over 500,000 lines of modified code, making for a small release.
-
System76 Refreshes Meerkat Mini PC
If you're looking for a small form factor PC powered by Linux, System76 has exactly what you need in the Meerkat mini PC.
-
Gnome 48 Alpha Ready for Testing
The latest Gnome desktop alpha is now available with plenty of new features and improvements.
-
Wine 10 Includes Plenty to Excite Users
With its latest release, Wine has the usual crop of bug fixes and improvements, along with some exciting new features.
-
Linux Kernel 6.13 Offers Improvements for AMD/Apple Users
The latest Linux kernel is now available, and it includes plenty of improvements, especially for those who use AMD or Apple-based systems.
-
Gnome 48 Debuts New Audio Player
To date, the audio player found within the Gnome desktop has been meh at best, but with the upcoming release that all changes.
-
Plasma 6.3 Ready for Public Beta Testing
Plasma 6.3 will ship with KDE Gear 24.12.1 and KDE Frameworks 6.10, along with some new and exciting features.
-
Budgie 10.10 Scheduled for Q1 2025 with a Surprising Desktop Update
If Budgie is your desktop environment of choice, 2025 is going to be a great year for you.
-
Firefox 134 Offers Improvements for Linux Version
Fans of Linux and Firefox rejoice, as there's a new version available that includes some handy updates.
-
Serpent OS Arrives with a New Alpha Release
After months of silence, Ikey Doherty has released a new alpha for his Serpent OS.