Hello, in this article, I’ll explain how to install openSUSE Tumbleweed (however, these instructions would probably work in openSUSE Leap) in Raspberry Pi 4, plus install and configure a basic Samba server to share files from an external HDD.
The first thing to do is install the openSUSE Tumbleweed image on your Raspberry Pi 4. Go to the openSUSE Wiki page for Raspberry Pi 4 and download the image that you like to use.
There are six images available. Download the image you want (Leap is stable, Tumbleweed is rolling) from here. Choose your desktop type:
- JeOS - Just enough Operating System - a very basic system, no graphical desktop
- E20 - Enlightenment desktop
- XFCE - XFCE desktop
- KDE - KDE desktop
- LXQT - LXQT desktop
- X11 - basic X11 system
The direct links did not work for me, so I went to the general download directory and downloaded the latest JeOS image named openSUSE-Tumbleweed-ARM-JeOS-raspberrypi.aarch64.raw.xz
As root extract the image onto your SD card or USB device(replace sdX with the device name of your SD card).
If possible, it is better to use a decent USB 3 device as the read and write speeds are greater than SD cards. I’ll use the USB device as the media used to install the image from now on.
WARNING: this is a destructive operation. All previous data on the device will be lost. Check first if the device you have selected is really your target device!
xzcat openSUSE-Tumbleweed-ARM-JeOS-raspberrypi.aarch64.raw.xz | dd bs=4M of=/dev/sdX iflag=fullblock oflag=direct status=progress; sync
After the image is extracted to the USB device, you can insert it into your Raspberry Pi 4 and turn it on.
You will need to discover the IP address of your Raspberry Pi 4. This can be done in a hundred different ways. For example, you can look at your router DHCP table for a MAC address that belongs to “Raspberry Pi Trading Ltd”.
Wait 5 minutes before the first login as the OS will perform some tasks at the first boot, like resizing the ext4 filesystem to the entire disk.
SSH is enabled by default in openSUSE images so that you can log in as root with:
The default password is “linux”.
Find your keyboard layout and load it. To search your keyboard, type:
In my case, I use a Brazilian keyboard layout called “br-abnt2”. Load your keyboard layout with:
For security reasons, change the default root password.
Type once and then confirm your new password.
Check for available system updates.
zypper dup --details
Install vim and vim-data to have a better editing experience. You can use the editor that you prefer.
zypper in --details --no-recommends vim vim-data
Change the hostname as you like.
hostnamectl hostname your_hostname
Create your user account.
useradd -m -s $(which bash) your_username
Configure the sudo commands allowed for your account.
visudo -f /etc/sudoers.d/your_username
your_username ALL=(ALL) ALL to the file and save it.
As the server administrator, I’ll give my user account the right to run all commands as root.
Now configure sudo to ask for your password instead of the root password.
Comment the following lines:
Check if is everything correct with your sudo related files.
If there is some problem, you can fix it by editing the file.
Set a password for your user account.
Reboot the system to be able to SSH with your user account instead of the root account.
Log in with your user account.
Now we will mount the external HDD to
First we discover the UUID for the external HDD.
lsblk --fs --output UUID,TYPE,FSTYPE,LABEL,MOUNTPOINT
Create the mount point.
mkdir -p /mnt/externalhdd
Edit the /etc/fstab file and add the line for the external HDD. Observe that in this case, the external HDD is formatted as ext4. Adjust according to your needs.
Test the mount point.
If everything worked correctly, you should see no output.
Now you can install the Samba server.
sudo zypper in --details --no-recommends samba samba-doc
Backup the original Samba configuration file.
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.bkp
To better understand the options, copy a fully commented example file from the Samba documentation.
sudo cp /usr/share/doc/packages/samba/examples/smb.conf.default /etc/samba/smb.conf
In this article, other than users, I 'll use a group to control the access to the shared folders.
Add a group called
smbusers or whatever you like.
sudo groupadd smbusers
Create a Samba password for the user that will have access to the shares. This password can be different from the user account password.
sudo smbpasswd -a your_username
Edit the Samba configuration file. For simplicity, I’ll omit some comments, but I strongly recommend reading the Samba documentation to properly understand the options.
sudo vim /etc/samba/smb.conf
- All shares will require the Samba password.
- I’ll use
your_usernameto illustrate a real user replace with a proper user name.
Test the Samba configuration file.
This final part enables the Firewall and allows the Samba ports through it.
sudo systemctl enable --now firewalld.service
In this case, we are using the “home” firewall zone and the interface “eth0”.
sudo firewall-cmd --set-default-zone=home
sudo firewall-cmd --zone=home --change-interface=eth0
Allow the Samba service through the Firewall.
sudo firewall-cmd --zone=home --permanent --add-service=samba
Reload the firewall configuration.
sudo firewall-cmd --reload
Enable and start the
sudo systemctl enable --now smb.service sudo systemctl enable --now nmb.service
Reboot your Raspberry Pi, and you should have a working Samba server sharing your external HDD.
sudo systemctl reboot