- Step 1: Download OS
- Step 2: Imaging software
- Step 3: Flash the SD card
- Step 4: Connect Ethernet
- Step 5: First Boot
- Step 6: SSH Access
- Step 7: Change the Password
- Step 8: Update the System
- Step 9: Set the Keyboard (Optional)
- Step 10: Set the Timezone (Optional)
- Step 11: Reboot
- Step 12: Configure the WiFi (Optional)
- Step 13: Adding Applications
- Step 14: Shutdown
Learn how to get started with the ROCK 4C+ single board computer on Ubuntu Server and run it flawlessly for the most courageous and demanding projects, such as multimedia or industrial applications. Roll up your sleeves, and let’s get this beast ready to ROCK in just a few simple steps.
The ROCK 4C+ SBC is extremely practical and can run on several Officially supported 64-bit Operating Systems (OS), plus several Unofficial versions, giving you plenty of options for your particular requirements.
This Getting Started Guide shows how to install Ubuntu Server 20.04 (Focal) onto an SD card for the ROCK 4C+ single board computer ending up with a correctly configured headless server setup, which runs without a monitor or keyboard attached.
Q: What is an Ubuntu Server used for?
Ubuntu Server is a great starting point for a Web Server Embedded system connected to the GPIO or an IoT Gateway, for example. Because there is no monitor attached, access is via remote login over SSH, and the Linux command line is used throughout.
Once the OS is set up, you can choose to add additional software from a selection of 1000’s of Open Source applications in the Ubuntu repository.
So, let’s get started!
Time: 30 Min
Parts Needed to Get Started with ROCK 4C+ on Ubuntu:
ROCK 4 Model C+
OKdo Universal Power Supply
Step 1: Download OS
Download a copy of the Official image for Ubuntu Server for the ROCK 4C+ board from the Radxa downloads page. You can use either a Windows, Mac or Linux host PC. Save the image file to your Downloads directory:
- Visit Radxa’s Wiki and click the Ubuntu Server (20.04) link for the ROCK 4C+ model;
- Allow the image file to download – it is about 300 MB in size;
- The filename will be similar to this depending on the version date: rockpi-4b-ubuntu-focal-server-arm64-20221109-1302-gpt.img.xz;
- There is no need to expand the compressed file.
Note: Choose the correct image for your board; otherwise you may experience problems booting. The installation process is similar for all boards.
Step 2: Imaging software
OS images need special-purpose imaging software to flash the image file to the SD card. We recommend the Open Source balenaEtcher, which is available for Windows, Mac or Linux. It also performs some validation checks on the flashed image:
- Visit the download page at balenaEtcher and install the version for your host operating system.
Step 3: Flash the SD card
Now everything is ready to flash the OS image onto the microSD card. Use a good quality, branded, 32GB card. We use SanDisk Ultra cards which are fast, durable and reliable.
- Insert the SD card into a card reader on your host PC;
- Open balenaEtcher and select the OS image you downloaded in Step 1;
- Select the SD card to flash – be careful to choose the correct one;
- Click the Flash button;
- Wait for the imaging and validation process to complete, then eject the SD card and remove it from your host PC.
Tip: If your system asks you to format the card at any time, click cancel.
Step 4: Connect Ethernet
Now that your SD card is prepared, connect up your ROCK 4C+ board to Ethernet to allow network access. No keyboard, monitor or mouse is required as the image is set up for remote access over SSH.
- Connect a CAT5 Ethernet cable to the Ethernet port and your internet Router / Switch;
- Carefully insert the SD card into the card socket with the gold pins on the card facing upwards;
- Connect the power supply to the USB-C socket but do not plug it in yet.
Connections to ROCK 4C+ board:
Step 5: First Boot
Check that everything is prepared as in the steps above, and plug in the power supply into the ROCK 4 board and wait for it to boot:
- The green power LED will turn on, and the blue activity LED should start blinking after a few seconds;
- The first boot can take about 60 seconds… Just be patient!
- Once the boot process has finished, the board should be visible on your Router admin page.
Open a Terminal on the host PC and check you can reach the ROCK 4 board over the network by sending a ping request using the hostname rock-4c-plus:
You should get a response showing the IP address of the ROCK 4 on your network and other details. On some networks, you may need to use Multicast DNS (mDNS) by adding .local to the hostname:
Or even the IP address of your board in place of the hostname:
Use Ctrl + C to stop the ping.
Tip: Each board will have a different IP address according to your network configuration and can be found on your router’s admin page.
Step 6: SSH Access
Once a connection with your board is confirmed, you can start a remote session over SSH. This gives secure access to the ROCK 4C+ from a Terminal on your host PC.
- Open a Terminal session on your host PC and perform a remote login as user rock using the hostname or IP address in Step 5;
- When prompted, use the default password rock;
- You should now see that your shell prompt has changed to show that you are logged into your ROCK 4C+ board remotely.
Tip: Windows 10 users can use SSH directly from the CMD window – no need to install Putty or other terminal emulators.
Step 7: Change the Password
In the remote session, change the default password. Use a secure password to keep your system safe. Passwords should consist of a minimum of 8 characters, including one or more characters from each of the following sets:
- Upper and lower case characters;
- digits 0 thru 9;
- punctuation marks.
Step 8: Update the System
The OS and installed software is constantly being updated to maintain system security and fix issues. It is recommended to perform a system update from the remote session initially and regularly after that:
sudo apt update sudo apt upgrade
Accept the updates and allow all the updated packages to install, which can take a couple of minutes the first time.
Tip: All important system commands require root privileges which can be obtained temporarily by prepending the sudo command – the rock user password should be used.
Step 9: Set the Keyboard (Optional)
The correct keyboard setting should be detected from your SSH session. You can change it by editing the XKBLAYOUT value in /etc/default/keyboard using vi or nano. For example, to change from US to UK keyboard layouts, change the following line:
XKBLAYOUT=”us” to XKBLAYOUT=”gb”
The keyboard setting will change after rebooting.
Step 10: Set the Timezone (Optional)
The default time setting is Universal Time (UTC). Local Time can be set this using the timedatectl in the remote session:
- Display a list of available timezones (press F key to page forward):
- Set your local timezone from the list using this command with the example for London, UK:
sudo timedatectl set-timezone Europe/London
- Check the settings with the following command:
Tip: Linux commands are case-sensitive, so follow any capitalization exactly, and once you have typed a few characters, press the Tab key to use auto-completion.
Step 11: Reboot
Once the basic system configuration is complete, reboot the system for all the changes to take effect. The session will be automatically closed by the remote host.
Once the system comes back up, use SSH to login in again as in Step 6:
Your ROCK 4C+ system is all set up, up to date and ready to use via Ethernet.
Step 12: Configure the WiFi (Optional)
An extra configuration step is needed if you want to connect your ROCK 4C+ using WiFi. Open the Terminal as superuser and issue the following commands, replacing the text in angle brackets with your own settings for your WiFi access point:
sudo nmcli radio wifi on
sudo nmcli device wifi
sudo nmcli device wifi connect <ssid> password <password>
WiFi settings are stored in the file /etc/NetworkManager/system-connections/<SSID>.nmconnection
WiFi can be turned off with the following:
sudo nmcli radio wifi off
Step 13: Adding Applications
The Ubuntu Server image is already configured with many useful applications and utilities, but there are over 52K Open Source software applications to choose from in the Ubuntu repository, most of which will work with the ROCK 4 boards. You can search or browse the repo in several ways by visiting the following page and clicking the Focal (20.04) link or by using the search functions.
Once you know the name of the package, it can be installed from a remote session, along with any dependencies. Here we are installing the Nginx web server:
sudo apt install nginx
Step 14: Shutdown
Always shut down your system properly before removing the power supply to avoid corrupting the SD card. Perform the poweroff command and wait for the blue activity LED to stop flashing before removing power:
If you have followed all the steps in this guide you will have a nicely configured Ubuntu Server system for your ROCK 4C+ board. This is a base setup for a network attached device that you can administer over SSH from anywhere on your network.
Let’s invent the future together
What’s your challenge? From augmented reality to machine learning and automation, send us your questions, problems or ideas… we have the solution to help you design the world. Get in touch today.
Excited to discover what other ROCK single-board computers, compute modules, and accessories are in our range? View more in our ROCK Shop, and find the perfect Raspberry Pi alternative. You no longer need to hunt for stock!
Projects & Inspiration
Get Started Guides
Discover OKdo Blogs