Pi Desktop

Setting Up a DIY Pi Desktop Kit


DIY Pi Desktop Kit

The Element14 DIY Pi Desktop Kit is a kit of accessories that allow you to convert a Raspberry Pi 2 or Pi 3 into a desktop computer. The kit includes a case and an add on board, similar to a HAT, that plugs onto the 40 pin GPIO connector of the Raspberry Pi. This add on board contains a Real Time Clock (RTC), and a connector for a mSATA Solid State Drive (SSD).

Kit Contents

The full DIY Pi Desktop kit consists of the following items:-

  • Button cell for Real Time Clock (RTC)
  • Enclosure (base and lid)
  • Add on board
  • Heat sink (for Raspberry Pi processor)
  • USB to micro USB adaptor (for USB to SSD connector)
  • Standoffs and screws (for mounting Pi, add on board and optional SSD)

DIY Pi Desktop Kit Contents

Additional Items Required

For a complete DIY Pi Desktop, the following items are also required:-

Building The Kit

The DIY Desktop Kit comes with a very basic set of instructions on how to construct the kit. However, there is also a more comprehensive user manual available at the Element14 web site. For the main part of our build, we followed the instructions in the user manual. However, we did find that it was still necessary to carry out some additional steps which were not documented in this guide.

The first part of building the desktop kit was to attach the supplied heat sink to the processor of the Raspberry Pi. Having done this, we also inserted a micro SD card that had been programmed with the latest Raspbian image. If you’re not sure how to prepare an SD card, take a look at the software guide on the Raspberry Pi Foundation’s web site.

We decided that we didn’t want to attach a camera to our Pi Desktop. Also, because it’s not easy to access the micro SD card once the Pi is mounted inside the enclosure, we thought it would be better to get everything working before fitting the Pi into the enclosure. Thus, the next step for us was to fit the button cell into the holder onto the back of the add on board.

Button Cell Fitted

Next, we fitted the add on board onto the GPIO header of the Raspberry Pi.

Pi and Add On Board

Also, because we wanted to add an SSD to our Pi Desktop, we needed to fit the USB to micro USB adaptor into the USB to SATA port on the add on board.

USB to SATA Adaptor

Finally we needed to install our Solid State Drive (SSD) onto the add on board using the 2 small screws provided.

SSD Fitted

Powering Up

The hardware completed, the next step was to connect a USB keyboard and mouse, and HDMI monitor to the Raspberry Pi. The Raspberry Pi is powered from the add on board, so the power supply was connected to the ‘power in’ micro USB socket on this board. Switching on the power supply will provide power to the board, but to boot the Raspberry Pi it is still necessary to push the small button in the corner of the add on board. Having done this, the LED on the board will light up, and the Pi will begin to boot.

Once booted, the required software setup can begin.

Software Setup

If your Pi is not connected to a network, you’ll need to configure the WiFi to connect to your wireless network. Also, as with any new Raspberry Pi setup, it’s always a good idea to configure the Pi for your time zone. Following this, you should also carry out an operating system update to ensure everything is up to date. To update the Raspbian operating system, enter the following commands into a terminal window:-

sudo apt update
sudo apt upgrade

Next, it is necessary to install the software required for the Pi Desktop. This is done by browsing to the Element14 Pi Desktop web page and downloading the Pi Desktop Debian image file. Once downloaded, the software is installed using the command:-

sudo dpkg -i pidesktop-base.deb

Cloning the Operating System

The next step in the installation instructions is to clone the file system from the SD card to the Solid State Drive. However, we found that this would not work using the command suggested:-

sudo ppp-hdclone

Using this command, the SD card copier application did not allow us to select either a source or target device.

ppp-hdclone

Partitioning the SSD

Realising that the problem with the SD card copier could be due to the SSD not being partitioned yet, we tried this as our next step. To do this, it is first necessary to create a partition table on the SSD using an application such a gparted. So, our next step was to install gparted using the commands:-

sudo apt update
sudo apt install gparted

Once installed, gparted is run using the command:-

sudo gparted

This will initially display a screen showing the partitions on the boot device.

gparted sd

Selecting the SSD device from the drop down list shows that the SSD contains a single unallocated partition.

gparted ssd unallocated

To create the partition table on the SSD, select ‘Device’, ‘Create Partition Table’. This will prompt for the type of partition table to create. Because our SSD will only be required for hosting linux, we selected ‘gpt’ as our partition type.

gparted gpt

Pressing the ‘Apply’ button will result in the partition table being created on the SSD.

Cloning the Operating System (take 2)

Having created the partition table on our SSD, we again tried to clone the operating system using the command suggested:-

sudo ppp-hdclone

However, as before we were unable to select either a source or target device. Instead, therefore, we decided to use the ‘dd’ command to copy our operating system. For more information on this, take a look at the section ‘Creating a Backup Image of a Live System’ in our article Raspberry Pi Top Tips.

In order to carry out this operating system copy, we needed to know which devices to copy from and to. The command:-

sudo blkid

shows us the devices available to us.

sudo blkid

From this list of devices, we need to copy from device /dev/mmcblk0 to device /dev/sda, using the following command:-

sudo dd if=/dev/mmcblk0 of=/dev/sda bs=1M

sudo dd

Once this device copy is complete, we can take a look at our copied operating system using gparted, and looking at the SSD device.

gparted copied file system

From this it can be seen that the copied file system only uses a fraction of the SSD, leaving the major proportion of the device unallocated. In order to use this space, all we needed to do was to resize the ext4 partition to make use of this unallocated space on the SSD. This is done using gparted, by selecting the ext4 partition, selecting ‘Partition’, ‘Resize/Move Partition’, then resizing the ext4 partition to use all the unallocated space on the SSD.

gparted resize partition

Clicking the green tick will commit this change to the partition table, and resize the partition on the SSD.

gparted partition resized

Booting From SSD

In order to boot from the SSD, it is necessary to modify the Raspberry Pi to allow it to be booted from a USB device. Details on how to do this can be found in the section ‘Booting a Raspberry Pi 3 From a USB Flash Drive’ in our article Raspberry Pi Top Tips.

Having carried out the necessary steps to update the Raspberry Pi 3 to boot from the USB device, we removed our SD card from the Raspberry Pi and checked that the Pi would boot from the SSD. From this point on, the SD card does not need to be inserted into the Pi micro SD card slot.

Finishing It Off

Once happy that the Raspberry Pi would boot from the SSD without the SD card in place, it was time to put everything into the Pi Desktop enclosure. The first step in doing this is to place the Raspberry Pi into the case, and use the 4 long standoffs to screw it in place.

Pi 3 In Enclosure

Next, the add on board was placed on top of the Pi, and the 4 screws used to secure the board in place.

The finishing touch is to check that everything still works, and finally push the lid onto the enclosure.

Pi Desktop