I have been using my old Raspberry Pi with Q4OS for quite a while now but due to it’s poor performance (the Pi is a fist edition) I have not really done too much with it. I now have a Pi 3 Model B and with the increased cores and speed it has become so much more useful!
I wanted to run this Pi headless and so had to do a little bit of messing about to get it running how I wanted but with it all set up it is a great addition to my machines and I will document here how I did mine.
Fist thing you will need to do is download the image to write to your SdCard, the image is available from the Q4OS download page and do not forget to check the bottom of the page to get the md5sum of the image for verification.
Now you have your image and have verified that it is correct according to the md5sum you will need to unpack the zip file, this is a very simple command
unzip 2019-04-08-raspbian-stretch.zip
Now you can write it to your SdCard, the method I use is the command “dd” and the full command is as follows:
sudo dd bs=4M if=2019-04-08-raspbian-stretch.img of=/dev/sdc status=progress conv-fsync
Please note that you must first check you are writing to the correct device, mine is /dev/sdc and can be found by using the lsblk command, the part of the output to look for would be similar to this, noting at least the device size matches your device :-
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
sdc 8:32 1 30G 0 disk
└─sdc1 8:33 1 30G 0 part
Note: always write images to the disk (sdc) and not the partition (sdc1)!
After writing the image to your SdCard you should mount the boot partition and add a blank file named ssh to the root directory, the command in my case was
sudo touch /media/dai/boot/ssh
After that you can now un-mount the device and remove it from your Pc and insert it to the Raspberry Pi. At the same time you will need to connect the Pi to an ethernet connection to allow us to set-up the WiFi. Power on the device and you can now go back to the Pc to do everything else.
You will need to get the IP address of the Raspberry Pi, this is easiest found by looking at your router config, mine is set to 192.168.1.254 by default and typing that address into my web browser allows me to see the active connections. Some routers will need you to log in before being able to see any information so you should refer to your router’s documentation to get that.
With the IP address you can now SSH into the Pi to get everything configured. remember that when using SSH you will need to specify the user as pi otherwise it will defailt to your local username which in my case would be dai and the connection would fail. My command looks like this
ssh pi@192.168.1.20
During the course of setting my Pi up I reboot the Pi to ensure everything is configured and working correctly, you may not need to do this although I have found it leads to less errors and is easier to find out if there has been a problem.
First I always update the apt db
sudo apt update
Then I enter raspi-config
sudo raspi-config
And expand the filesystem to use the whole SdCard, this option is found in the “Advanced Options” of the menu, after this I exit raspi-config and reboot the device.
SSH back into the Pi and now I upgrade the packages, to do this simply type the following command
sudo apt upgrade
this may take a while depending on your network connection and it is advisable to reboot again after this procedure especially if there has been a kernel upgrade.
After the reboot SSH into the Pi and enter raspi-config again, now we are going to set-up VNC, this can be found in the interfacing options, click on VNC and it should install it to the Pi, after it has finished it should tell you that VNC has been enabled.
One more setting to adjust to make things easier when we VNC into the Pi is to set the screen resolution, I usually set mine to 1080p (1920×1080) although if you have a smaller display you might prefer to use a lower resolution, you can choose from the options available in Advanced options -> Resolution. When this has been set you should exit raspi-config and reboot.
Now we need to install RealVNC Viewer on the Pc to view our desktop, for this you should download it from realvnc.com, the download page can be found here: https://www.realvnc.com/en/connect/download/viewer/ I downloaded the standalone x64 version but there are packages available to install to your system if you prefer. If you use the same package as me you should also copy the sha256 checksum and verify it has downloaded correctly, if everything looks good you should now make it executable with the following command
chmod +x VNC-Viewer-6.19.325-Linux-x64
This was the version available at time of writing but you should check the version you have downloaded for the correct name (and version number).
For the first run you could simply start the package from the command line as this will give you some feedback in case of any errors. When this starts you should select New connection from the File menu, you will need to enter the IP address in the box marked VNC Server and you can name it anything you want in the name box, this is only temporary as we will set up a new connection when we get WiFi working. Leave all other settings as default and click OK.
Now double-click your new Icon and it should show an Identity check dialog box, this only happens the first time you connect and should be ok to simply click Continue, now you will need to enter the username and password, as we have not yet changed it it is still the default pi and raspberry and click OK and you should now have the Q4OS login dialog, enter the username and password and login to the desktop.
You will now be asked if you want to change the DPI settings, usually this is not required and you can click on cancel, next it should confirm that Wireless networks are available, click OK, now you will be asked if you want to keep the current system language, you can change this if you need to but I didn’t need to and so clicked yes to keep it. Next you will be asked for a new password for the user pi, enter something here and please remember the usual warnings about security when setting passwords, this dialog will also give you a visual indication of how secure you password is (password strength meter), when this is set it will give you a confirmation dialog.
The last thing before you get to your desktop is the desktop profile, you have three options, Full featured, Basic and keep installed, I usually use the keep installed option as I know exactly what software I want to install and do not want the usual array of packages, I usually advise new users to go with the Full desktop option as it will give you a selection of packages including Chrome web browser and Libre Office as well as many other often used packages, select the option you want and click install, when that has finished it will give you a confirmation dialog and then proceed to launch the desktop.
Finally we can now configure WiFi, click the network icon in the taskbar and hover over the Connect to new network line, this will give you a list to select your Access point (router) for wireless connection, from this dialog box if the essid is correct you can click next, from this next page you can enter your WiFi key and click next, the next page is for manual IP configuration and can usually be ignored so click next, and on this last page be sure to check the box to Autoconnect otherwise you will not have a WiFi connection available for VNC, now click Connect & Save and you should notice your network connection icon change to the Wireless connection symbol.
One final thing we need to do is get the WiFi IP address, I do this in a terminal with the command ifconfig, take note of the address for wlan0. Now shutdown the computer and remove the ethernet cable, you can now place the Pi wherever you want it to be remembering you will need to be in range of your WiFi signal.
Now from VNC Viewer you can delete the old connection as we will no longer need it and create a new connection using the IP address for Wlan0 that you got in the last step, go through the same procedure again although this time you will not need to set up the device again as we have already done that, you can now use your Pi headless for whatever you need to do with it.
I hope you find this guide helpful and if there is anything that is not clear / missing or you think is wrong please let me know and I will adjust it accordingly.
Dai Trying