Raspberry Pi Setup For Information Screens

I have a customer who needed several non-interactive displays for their business.  There are in fact many reasons you might want this; for example, menu displays in a restaurant are often done like this.  My customer needed these displays in public areas where there would be little room to hide a computer.  We wanted to display a (local, intranet) web page which would update itself nearly in real-time to follow some business statistics, but we could have been displaying pretty much anything.

My solution was to use the Raspberry Pi Zero W, a tiny single-board ARM computer with built-in wifi.  The system boots from a micro SD card, which you preload with a copy of what they now call Raspberry Pi OS.  Basically it’s a customized Debian installation.

Note that these instructions are relevant as of November 2020.  If it’s been a while since I wrote this, well, expect some changes.  Also note, this is my very easy way of setting up such a display; don’t expect it to be the most efficient or elegant solution, just one that works.

To begin, download the Raspberry Pi OS Lite image from the website here and copy it to an appropriate micro SD card (there are instructions on the site).  We’re using the “Lite” image so we can install just what we need.

Set up your Raspberry Pi for interactive use for the moment.  You probably won’t need a mouse but you will certainly need a keyboard.  Put in the card you prepared and power it up.  When it gets to the login prompt, the username is pi and the password is raspberry.

We are running without a GUI, so to connect to the Internet we need to connect to wifi using the raspi-config script:

$ sudo raspi-config

In the provided menu, go to Network Settings.  After selecting your country, you’ll be prompted for SSID and passphrase.  Note that if you are using a wired model of Raspberry Pi, you won’t have to do this step; however, you still need to be in raspi-config for the next part.

Next, go to Localisation Options and set up your country and time zone information.  You might not need this, but it only takes a moment so why not?

Now, and this is kind of important, go to the Advanced Settings and disable Screen Blanking.  In the same menu, choose the option to expand the partition so you have all the available space allocated.

With all of that done, exit the menu using the Finish option, and let it reboot, and log in again.

Now we should update the operating system, and install some packages we need for this project:

$ sudo apt update
$ sudo apt upgrade
$ sudo apt install chromium openbox lightdm

Chromium will be used to display whatever information we are wanting to show.  Installing OpenBox will automatically install a minimal X Windows environment; OpenBox has a simple mechanism for automatically starting programs and does not show any menus or widgets on the screen by default (as in olden days, you click on the root window to get a menu).  LightDM will permit us to arrange automatic login, so the system will go straight to our screen view.

After all of these installations are done, there are several things you need to do.  First, go back into raspi-config (as above) and choose System Options, Boot / Auto Login, then Desktop / CLI.  Choose the option for a graphical desktop with automatic login, then exit out as before.

DON’T reboot yet!  Now we need to set up the autostart situation for the default “pi” user account to autostart a Chromium session.  In the folder $HOME/.config/openbox edit (or create) a file named autostart and put in these lines:

#!/bin/bash
xset -dpms
xset s off
xset s noblank
/usr/bin/chromium --noerrdialogs --disable-infobars --kiosk https://my.website.com/

The first three lines are intended to prevent the screen from blanking.  Even though you turned it off in raspi-config, X may still want to blank the screen, and you don’t want that.

The third line starts a Chromium session, with no navigation or informational bars, no error dialogs, and in “kiosk mode.”  These options should present a totally blank, frameless window in which your chosen web page will appear.  Of course, you must change the URL given to whatever page you have chosen to display.

Don’t forget to mark the file readable and executable:

$ chmod a+rx .config/openbox/autostart

Now, reboot.  With any luck, everything will Just Work…

BUT IT DIDN’T

The only problem I’ve encountered with this procedure is that the chromium package doesn’t work right on some Raspberry Pi units, and no, I don’t know why.  I get “Illegal Operation” as an error output on those systems.  The best option I’ve found is to substitute the chromium-chromedriver package:

$ sudo apt install chromium-chromedriver

Note that apt will uninstall the chromium package when you do this; also, you have to change your command path from /usr/bin/chromium to /usr/bin/chromium-browser in the autostart file.  So far this has worked reliably for me when the error occurs.  Possibly I should update the instructions above and just run this package by default, but as of right now I have Raspberry Pi units working both ways.

BONUS ROUND

You can install OpenSSH for remote access.  If you do this, first CHANGE THE PASSWORD from the default!

$ passwd
$ sudo apt install openssh

If you are setting up the Raspberry Pi on one network, but intend to deploy it to another, the handy wifi setup tool Comitup may be helpful.  Installing it is easy:

$ sudo apt install comitup

Using it is pretty simple too; I don’t think I can improve on the original author’s docs here: https://davesteele.github.io/comitup

Setting Up Mirrored Boot Hard Drives in Windows 10

This is a thing I have to do from time to time, and up to now I’ve been depending on two different sets of instructions (because one was not correct for Windows 10, and the other isn’t complete). So I’ve finally written my own instructions, and here they are.

Disclaimer

This is a somewhat advanced procedure.  Try it at your own risk.  I will not be responsible if this kills your computer, eats your family pictures for seven generations, or causes the heat death of the universe… or any other bad thing, big or small.  This is the procedure I used yesterday, and as far as I know it’s good, but follow it at your own risk.

Introduction

First, it’s important that the partition structure of the boot drive be “normal,” that is, the way Windows 10 would create it. The instructions below won’t work right if the partitions are in a different order. Unfortunately, many system builders (including my distributor) use a non-standard partition layout.

So for me, at least, the first thing to do is to erase the hard drives with zeros (I use a Linux boot flash drive for this) and then reinstall Windows 10 on the primary drive. This task will not be described here, as it’s a very basic procedure.

Assuming we are starting with the first hard drive having a more or less default Windows installation (on a GUID formatted drive), and the second being entirely blank, here’s how we do it:

Duplicate the Recovery Partition:

Open an administrative command prompt window, then run the diskpart command. We need the information about the Recovery Partition, so execute these commands:

1
2
3
select disk 0
select partition 1
detail partition

You should get something like this:

1
2
3
4
5
6
Partition 1
Type    : de94bba4-06d1-4d40-a16a-bfd50179d6ac
Hidden  : No
Required: Yes
Attrib  : 0X8000000000000001
Offset in Bytes: 1048576

Volume ### Ltr Label Fs Type Size Status Info
———- — ———– —– ———- ——- ——— ——–
* Volume 4 Recovery NTFS Partition 529 MB Healthy Hidden

Take careful note of the Type ID (i.e. Type, above) as well as its size.

Now make sure the second drive is GPT and completely empty, then create a new Recovery Partition there:

1
2
3
4
5
6
7
8
9
select disk 1
clean
convert gpt
select partition 1
delete partition override
create partition primary size=529 (or whatever size is given in the details)
format fs=ntfs quick label=Recovery
select partition 1
set id=de94bba4-06d1-4d40-a16a-bfd50179d6ac (or whatever Type ID was given in the details)

We’ll need drive letters assigned to both the original and the duplicate recovery partitions:

1
2
3
4
5
6
7
select disk 0
select partition 1
assign letter=q
select disk 1
select partition 1
assign letter=r
exit

That last command will take you out of diskpart. Now we need to use robocopy to make a duplicate of the original recovery partition:

1
robocopy.exe q:\ r:\ * /e /copyall /dcopy:t /xd "System Volume Information"

Duplicate the EFI System Partition:

Next, we need to duplicate the EFI System Partition. Back into diskpart:

1
2
select disk 0
list partition

You’ll get something like this:

1
2
3
4
5
6
Partition ###  Type              Size     Offset
-------------  ----------------  -------  -------
Partition 1    Recovery           529 MB  1024 KB
Partition 2    System              99 MB   530 MB
Partition 3    Reserved            16 MB   629 MB
Partition 4    Primary            930 GB   645 MB

Note the sizes of the System and Reserved partitions, and recreate them on the second drive:

1
2
3
4
5
select disk 1
create partition efi size=99 (or whatever the partition list indicates)
format fs=fat32 quick
assign letter=t
create partition msr size=16 (or whatever the partition list indicates)

We need the primary disk System partition to have a drive letter:

1
2
3
4
select disk 0
select partition 2
assign letter=s
exit

Now we’re out of diskpart again, off to robocopy:

1
robocopy.exe s:\ t:\ * /e /copyall /dcopy:t /xf BCD.* /xd "System Volume Information"

Mirror the Operating System Partition:

Most instructions say to close the Admin CMD window at this point, but you can honestly just ignore it; you’ll need it again later, so close it or leave it
open, does not matter.

You need to launch diskmgmt.msc now, or just go to Computer Management and select the Disk Manager section. Right-click on the primary disk and choose Convert to Dynamic Disk, then do the same for the secondary disk. Finally, right-click on the C: volume and choose Add Mirror to choose a drive for the mirror. Select Disk 1 and click the Add Mirror button.

This is the boring part. You need to wait for the mirroring to complete before moving on to duplicating the BCD boot instructions (in the next part, below).

Prepare the BCD Boot Entries

The procedures done so far have created a proper mirror of the boot drive, and a boot menu item has been added to allow you to boot from the secondary plex (drive). However, if the primary drive fails, booting from the secondary drive may fail as well. It is possible to use a boot CD and repair the boot on the secondary drive, and this is always an option, but duplicating the BCD boot information on the secondary drive should remove any need for this.

If the Admin command prompt has been closed, you’ll need to reopen it; if the system has booted, you’ll need to reassign the drive letters for the EFI partitions. To do this, run diskpart and enter the following commands:

1
2
3
4
5
6
7
select disk 0
select partition 2
assign letter=s
select disk 1
select partition 2
assign letter=t
exit

Now you’re back at the command prompt. Type the following commands:

1
2
3
s:
cd EFI\Microsoft\Boot
bcdedit /enum

That last command should give you something like this (warning, long):

1
2
3
4
5
6
7
8
9
10
11
12
13
14
Windows Boot Manager
--------------------
identifier              {bootmgr}
device                  partition=S:
path                    \EFI\MICROSOFT\BOOT\BOOTMGFW.EFI
description             Windows Boot Manager
locale                  en-US
inherit                 {globalsettings}
default                 {current}
resumeobject            {6fb37501-3d6b-11ea-914e-85f8d8cf8c72}
displayorder            {current}
{6fb37506-3d6b-11ea-914e-85f8d8cf8c72}
toolsdisplayorder       {memdiag}
timeout                 30

Windows Boot Loader
——————-
identifier {current}
device partition=C:
path \Windows\system32\winload.efi
description Windows 10
locale en-US
inherit {bootloadersettings}
recoverysequence {6fb37503-3d6b-11ea-914e-85f8d8cf8c72}
displaymessageoverride Recovery
recoveryenabled Yes
isolatedcontext Yes
allowedinmemorysettings 0x15000075
osdevice partition=C:
systemroot \Windows
resumeobject {6fb37501-3d6b-11ea-914e-85f8d8cf8c72}
nx OptIn
bootmenupolicy Standard

Windows Boot Loader
——————-
identifier {6fb37506-3d6b-11ea-914e-85f8d8cf8c72}
device partition=C:
path \Windows\system32\winload.efi
description Windows 10 – secondary plex
locale en-US
inherit {bootloadersettings}
recoverysequence {6fb37503-3d6b-11ea-914e-85f8d8cf8c72}
displaymessageoverride Recovery
recoveryenabled Yes
isolatedcontext Yes
allowedinmemorysettings 0x15000075
osdevice partition=C:
systemroot \Windows
resumeobject {6fb37501-3d6b-11ea-914e-85f8d8cf8c72}
nx OptIn
bootmenupolicy Standard

The boot loader entry entitled “Windows 10 – secondary plex” was added when the C: drive was mirrored. Now we clone the working Windows Boot Manager:

1
bcdedit /copy {bootmgr} /d "Windows Boot Manager Cloned"

You’ll get a reply like this:

1
The entry was successfully copied to {6fb37507-3d6b-11ea-914e-85f8d8cf8c72}.

The GUID at the end will vary, of course. Use it in the following command:

1
bcdedit /set {GUID} device partition=t:

Now we need to export the BCD store to copy it to the T: drive:

1
bcdedit /export T:\EFI\Microsoft\Boot\BCD

This should complete the operation. Rebooting the system to remove any excess drive letter assignments is recommended.

Windows Update “Awaiting Restart” Fix

So say you have a Windows Update that isn’t finishing.  In the Windows Update Settings screen, beneath the update it says “Status: Awaiting Restart,” but you restart, and when you look it still says that.  Here’s the fix, collected from several different answers I found online:

First, you need an elevated command prompt.  Click start and type CMD in the search, but don’t press Enter; instead, right-click on the Command Prompt item that search should have found and choose Run as Administrator.  Say Yes to the prompt about making changes to your system… that’s exactly what we’re doing here.

Now you have a command window.  Enter the following commands one after another:

SC config wuauserv start= auto
SC config bits start= auto
SC config cryptsvc start= auto
SC config trustedinstaller start= auto

Now, restart your computer.  During the restart you should see the update actually running.

 

RemixOS: Honeymoon is over, Annulment granted

I tried, I really did, but I just can’t live with RemixOS.

At first, I was swayed by the beauty of it.  It’s so clean and neat and functional, and access to the Play Store means so many apps are available already.

But.  Try to set up printing.  Or certain other services.

Even when they work, you either (a) pay for them, or (b) look at ads.  Whereas, as a user of Ubuntu (or any other Linux distro, really) you get the same things for free with no ads.

The honeymoon is over, it seems.

The only thing I’ve found that it’s good for is a set-top box; the streaming apps for various video/TV services are really pretty nice, and having RemixOS on a computer connected to a TV set can be a good way to enjoy them.  But that’s it, the only use case that makes sense to me.

RemixOS Survival Guide, Part 1

RemixOS is a beautiful thing.  Android on a PC, simple and fast and pretty, and all those apps!

But while it’s a nice place to visit, it still takes a bit of work to live there.  So I’m going to document, here on my blog, the things I’ve done to make my “toy” computer someplace I could actually do business.

I’m going to start this in the middle, with something I learned later that it pays to know in the beginning.  Install the 32 bit version!  Even if you have a 64-bit-capable computer, your life will be easier (at least right now) in 32 bit land.  Apps that provide native Intel libraries often do not supply 64 bit versions… apps like PrintHand or Print Hammermill.

Let’s start with installing RemixOS on your computer.  If you, like me, want RemixOS to be the only OS on the computer, then start by either making a bootable USB flash drive containing your preferred edition (i.e. 32 bit, as I explained above) or burning the image to a DVD.  I had a problem with the computer I’m using for testing being unable to boot USB… turned out it won’t boot any USB flash drive.  So I did the burning option.

Rather than explain all of this myself, I’m going to chicken out and let someone else do it.  If you want to create a bootable USB drive on Windows, you want to start following the directions at this link.  When you get to step 5 and the menu appears (the GRUB boot menu, to be exact), press TAB to pause the boot and pick up the directions below.

If you are using a modern Linux distribution, install UNetbootin from your package manager and then run it.  Tell it you are putting an ISO on your flash drive, then point it at the one you downloaded.  Again, boot from it, and at the blue GRUB menu press TAB.

Okay, so, now you should be looking at the GRUB menu with a long string of garbage at the bottom.  That long string of garbage is the boot command string which tells Linux (the underlying kernel for Android) how to boot.  Without changing anything that is already there, add a space and then type in

INSTALL=1

at the end.  Press ENTER, and the RemixOS installation system will start up.

I’m assuming you want to use the entire hard drive for RemixOS.  If not, stop.  The instructions I’m about to give you will DESTROY the contents of your hard drive… if you have anything important on there, you need to back it up first.  No, I’m not going to explain how… Google for it.

If you are sure you are ready to erase that hard drive, well, here’s how you do it.  RemixOS will ask where you want to install it, and it will show you a list of the available partitions on all your hard drives.  You probably should start by choosing the option to change partitions, then choose your /dev/sda (the first hard drive).  When it asks if you want to use GPT, say no.  The next screen that comes up will be cfdisk, which will allow you to delete your partitions and create new ones.

After erasing your partitions, create a single partition for the entire hard drive, make it bootable, and then choose the Write option to save it.  Finally, choose Quit to move on.

RemixOS will ask about formatting the drive.  Choose ext3 or ext4 as the partition type (I’m not sure that it makes much difference which one you choose; ext4 is a bit better, technically).  You’ll be warned that you are going to erase the hard drive, but don’t kid yourself, you already did that in the last step.

The operating system will now install.  Walk away and let it work.

More later… look for Part 2, coming soon!

 

 

Installing SuperSU on Remix OS 2.0

I’ve been playing with Remix OS on a six-year-old Intel-based computer lately.  It has 2 GB of RAM (right now, but I do intend to put a bit more in it) and a 320 GB hard drive, and I have to say I haven’t been this excited about an operating system in a long time.  It is limited, certainly, but it is beautiful.

So I wanted to tinker with the power management, but for that I needed root access.  I installed Remix OS in “writable /system” mode, and so with a quick Ctrl-Alt-F1 I’m looking at a root prompt… but apps can’t access root that way.  For that you need something like SuperSU, which I run on my rooted tablet.

I’ll admit right now, if there is a way to boot into recovery mode on Remix OS, I haven’t found it yet.  But it turns out that, by hacking on some procedures for rooting other Android devices, you can still make this work.

First, download the current stable SuperSU zip file from here:

http://download.chainfire.eu/supersu-stable

Unzip it on your Remix OS device.  I just switched to the shell on the first VT and did it, but you can do it however you like.

From that first VT prompt, you’ll need to put the new su binary in place.  Assuming you unpacked the SuperSU file into a folder named SuperSU in the Downloads folder, you need to do this:

cd /system/xbin
mv su su.orig
cp /sdcard/Downloads/SuperSU/x64/su .
chmod 4751 su

NOTE that these instructions are for a 64 bit system.  For 32 bit, you need to substitute x86 for the x64 above see the EDIT section below.

Now switch back to the GUI (Ctrl-Alt-F7) and reboot the system.

Once the system has rebooted, open up your file manager and find the SuperSU folder (under Downloads, if you did it like I did).  Inside that folder you’ll find a folder named common, and inside that a file named Superuser.apk.  Double-click it to install.

After installing, start SuperSU.  It will tell you it needs to update; do that, and (with any luck) it will tell you it was successful, and that you should reboot again.  Do that, and again with any luck,  you are done!

Disclaimer:  This worked for me.  Your mileage may vary.

EDIT 6/9/2016 — I had trouble with apps that didn’t like the 64 bit RemixOS, so I scrubbed the system and installed the 32 bit version.  When I did, the instructions above did not work… the su binary doesn’t seem to be right for the system, but the su.pie file in the same x86 folder does.  So here are the updated commands to install on a 32 bit system:

cd /system/xbin
mv su su.orig
cp /sdcard/Downloads/SuperSU/x64/su.pie su
chmod 4751 su

Killing GWX (as in, I really don’t want Windows 10)

FOR THE NON-TECHNICAL:

So you’re happy with your Windows 7, 8, or 8.1 computer, and you just don’t want Windows 10 to install on it?  Got your fix right here.  Right-click the following link and choose Save Target As or Save Link As, then save it somewhere you can find it (in the Downloads folder or on your Desktop are good choices):

http://newcenturycomputers.net/user/KillGWX.reg

Now find the file where you downloaded it, and double-click it.  You will be asked up to four different times if you are really sure you want to run it… each question will be different, but in each case you need to go forward.  The last dialog will tell you the process is a success, and provide an OK button.

After you click the final OK, restart your computer in the normal way.  This should be enough to prevent Windows 10 from installing on your computer.  Note if you have msn.com as your home page, you will still see ads telling you that you should upgrade… just ignore them, or change to a different home page if it gets really annoying.

ORIGINAL POST:

I don’t use Windows myself, but I do sell and support computers that must run Windows.  Most of my customers are very fond of Windows 7, and even though its days are numbered they still want to keep using it.

When Microsoft pushed out the GWX update (KB 3035583, if you care), things became… annoying… for those people I just mentioned.  There’s no apparent way to turn that nonsense off.  The only solution I found in the early days was to kill the program, then change the privileges on the folder C:\Windows\System32\GWX and delete it.  So I went around doing just that.

And Microsoft re-issued the update, and they all came back.  Gah.

I searched again, and after extensive revisions of my Google search parameters I finally found a page on Charles Allen’s blog where he explained the secret.  But he gave the steps in the manual mode, and I’m too lazy for that.

So here’s a registry patch to do the job.

http://newcenturycomputers.net/user/KillGWX.reg

Mostly this is here so I can find it later… as usual for Notebook entries.

UPDATE:  In addition to the anti-GWX registry entry, I’ve become aware of the group policy option entitled “Turn off the Upgrade to the latest version of Windows.”  Even with GWX disabled by the aforementioned option, Windows Update may still offer Windows 10 as a “regular” Windows update (especially now that it is “Recommended” instead of merely “Optional”).  This new policy option just sets a registry entry, of course, and I’ve added that registry entry to my KillGWX.reg and uploaded it to the location above.

I found this information here:

Turn off the Upgrade to the latest version of Windows GPO

It’s been there for months, but it’s darned hard to find with an ordinary Google search; when I tried to find it again to post it here, I kept finding ways to block ALL Windows updates (not a good idea) rather than the specific upgrade block I was wanting.  So as usual, I’m posting it here so I can find it again.