Skip to content

Instantly share code, notes, and snippets.

@tanhueco
Created August 29, 2019 22:24
Show Gist options
  • Save tanhueco/c57e588b798b32b84d365a7487bf6667 to your computer and use it in GitHub Desktop.
Save tanhueco/c57e588b798b32b84d365a7487bf6667 to your computer and use it in GitHub Desktop.
ROON on Arch Linux
#################################################
ROON on Arch Linux on NUC or Comparable Hardware
#################################################
This is for those:
- Who already have NUC particularly NUC6i5SY series
- Uses a music server (SOtM sMS-200 or uRendu)
- Installed NVMe M.2 memory
- Have access to music files from NAS or equivalent fileserver through SMB
- Set Roon Server close to the music server using network bridge set-up to minimize cabling
- Option to ROCK using a homebrew Linux hardware
Thanks to @evand. Evand’s post forms the base of this guide. I decided to create another one to cater more specifically to
NUC6i5SY or equivalent NUC owners.
Arch Linux is a minimal install and probably the lightest OS that will run Roon server. The tradeoff in using Arch Linux is it is
not the most user friendy among the Linux distributions and tried a lot of them plus Solaris derivatives.
The set-up is primarily on NUC’s that uses NVMe memory, access to music files through SMB, no bootloader for faster boot time, and
bridged interfaces with an endpoint (e.g. SOtM sMS-200Ultra). It turns out that efibootmgr is not as friendly on NVMe’s when
direct booting to the OS through UEFI so that led me to modify the original guide.
The bridge set-up was added to allow setting up the Roon Server closer to the endpoint. In my case, I was able reduce the length of
my ethernet cable from 13 meters down to less than a meter while eliminating any router or switches that goes in between the Roon
server and the endpoint in the previous set-up. I didn’t expect to gain huge improvement with this new set-up but, to my surprise,
there is.
For bridge set-up, you’ll need a USB Ethernet Adapter for the 2nd ethernet port. I purchased the Pluggable USB 3.0 Ethernet Adapter
that uses the ASIX AX88179 controller chip for $14.75. You can find it in Amazon. Secret: This chip is currently supported in ROCK
:slight_smile:. The USB Ethernet Adapter will be connected to the home LAN while the built-in Intel ethernet port in NUC will go
to the music player.
##########################
Prepare source flash drive
##########################
For Linux:
Download the Arch Linux ISO file and write it to a flash drive as follows (where sdY represents the flash drive):
# wipefs --all /dev/sdY
# dd bs=4M if=/path/to/archlinux.iso of=/dev/sdY && sync
For Windows:
Download Rufus. Create a bootable USB drive using Arch Linux ISO image that can be downloaded from here. Use “GPT partition scheme
for UEFI” and “Large FAT32”
Configure BIOS and boot from source flash drive:
- Turn off compatibility mode and secure boot in the UEFI BIOS, connect network cable
- Check UEFI Boot
- You can keep Legacy Boot checked
- Uncheck Audio if using a music server, WLAN, and Bluetooth under Onboard Devices to minimize any unnecessary electrical noise
- Disabled “USB S4/S5 Power” under Secondary Power settings
- Disabled “Portable Device Charging Mode” under Devices and USB
- Check USB as Boot Device in Boot Configuration
Boot target machine from flash drive you’ve just prepared.
############################
Partition target flash drive
############################
After the boot sequence is completed insert the target flash drive on which you wish to install Arch Linux and determine its device
name:
# lsblk
Partition the target flash drive with 512MB partition of type ef00 and the remainder as a regular Linux partition using gdisk:
# gdisk /dev/nvme0n1
Wipe out the existing partitions on the target flash drive. Use expert mode (press x) and zap the gpt tables, mbr etc. (press z).
Then relaunch gdisk as above.
Once in gdisk press n and follow the prompts to size the partition table and set its type: +512MB and ef00 respectively. When done
with the first partition press n again and create a second (Linux) partition utilizing the remaining space on the flash drive. When
done press w and confirm writing of the partition tables.
Here’s the partition creating process for the 1st Partition:
Partition Number: 1
First Sector: 2048 (default)
Last Sector: +512MB
Hex Code or GUID: ef00
…type n
For the 2nd Partition:
Partition Number: 2
First Sector: (default)
Last Sector: (default)
Hex Code or GUID: 8300
…type w
#######################################
Format partitions on target flash drive
#######################################
Format the partitions FAT32 and EXT4 respectively:
# sync
# mkfs.fat -F32 /dev/nvme0n1p1
# mkfs.ext4 /dev/nvme0n1p2
Mount the Linux partition to /mnt and EFI System Partition to /mnt/boot:
# mount /dev/nvme0n1p2 /mnt
# mkdir /mnt/boot
# mount /dev/nvme0n1p1 /mnt/boot
##############################
Install Arch Linux Base System
##############################
Install the base system, generate an fstab (note the use of -U to utilize UUIDs for device identification) and load temp files to
ram:
# pacstrap /mnt base
(Wait until it Is finished. This may take a long time. The screen may go blank due to the screen saver. Pressing to activate the
screen again is safe.)
############
Set-Up FSTAB
############
# genfstab -U -p /mnt >> /mnt/etc/fstab
# nano /mnt/etc/fstab
Add the following to fstab to minimize unnecessary writes to the flash drive:
tmpfs /var/log tmpfs defaults 0 0
tmpfs /var/tmp tmpfs defaults 0 0
tmpfs /tmp tmpfs defaults 0 0
#########################################
Chroot into and configure the base system
#########################################
Change myhostname below to whatever you’d like your RoonBridge to be identified as on your network e.g. nucroonserver
# arch-chroot /mnt /bin/bash
# hwclock --systohc --utc
# echo myhostname > /etc/hostname
Add the same hostname to /etc/hosts:
# nano /etc/hosts
Edit the file to place it in the correct location so the line looks as follows:
127.0.0.1 localhost.localdomain localhost myhostname
::1 localhost.localdomain localhost myhostname
#####################
Locale and Local Time
#####################
Set locale by uncommenting the locale you wish to use, save the file and activate the locale. For example:
# nano /etc/locale.gen
Remove the hash “#” mark before your locale, e.g. en_US.UTF-8 UTF-8
# echo LANG=en_US.UTF-8 > /etc/locale.conf
# locale-gen
Create a symbolic link /etc/localtime to your subzone file /usr/share/zoneinfo/Zone/SubZone using this command as an example:
# rm /etc/localtime
# ln -s /usr/share/zoneinfo/America/Los_Angeles /etc/localtime
##############################
Bridge Interface Configuration
##############################
Copy a sample profile from /etc/netctl/examples to /etc/netctl and modifying it by changing eth0 to the ethernet port shown by ip
l. It is typically going to be something along like eno1 and enp0s20f0u3:
# ip l
# cd /etc/netctl
# cp examples/bridge my_bridge
# nano /etc/netctl/my_bridge
My set-up looks very similar to this:
Description="Bridge Connection"
Interface=br0
Connection=bridge
BindsToInterfaces=(enp0s20f0u3 eno1)
IP=static
Address=('192.168.1.100/24')
Gateway=('192.168.1.1')
DNS=('8.8.8.8' '8.8.4.4')
MACAddressOf=enp0s20f0u3
SkipNoCarrier=yes
Enable to bridge to run it permanently every reboot:
# netctl enable my_bridge
Set the root password and other essentials
# passwd
Install intel-ucode [basically intel microcode updates]:
# pacman -S intel-ucode openssh mc ffmpeg samba
Optional….If you run across mirror errors:
# nano /etc/pacman.d/mirrorlist
Delete or add a hash "#" before the mirror creating the problem. I'm having problem on arch.nimukaito.net in my case.
Enable root login via ssh:
# cd /etc/ssh/
# cp sshd_config sshd_config.org
# nano sshd_config
Find the following line in /etc/ssh/sshd_config:
PermitRootLogin prohibit-password
Remove the # and change prohibit-password to yes:
PermitRootLogin yes
Enable sshd:
# systemctl enable sshd.service
#####################################################################
Setup to have BIOS boot the OS directly
(This may be set-up already. Just left it here in case it is needed.)
#####################################################################
# mount -t efivarfs efivarfs /sys/firmware/efi/efivars
# bootctl --path=/mnt/boot install
Determine device UUIDs and create a configuration file to add an entry for Arch Linux to the boot manager:
# blkid >> /boot/loader/entries/arch.conf
# nano /boot/loader/entries/arch.conf
Remove UUID entries other than that pertaining to the flash drive and add the following (using your device UUID):
title Arch Linux
linux /vmlinuz-linux
initrd /initramfs-linux.img
options root=UUID=Insert_Linux_Partition_UUID_Here rw
Note on the above: Use the UUID from nvme0n1p2
Flush cache and exit chroot session:
# sync && exit
################################
Set-Up SMB Access to Music Files
################################
It is assumed that your music files are already stored somewhere in SMB NAS.
Add the following to fstab access your music files and Roon database backup from the fileserver (SMB):
# nano /etc/fstab
//192.168.1.xx/music /mnt/music cifs guest,sec=ntlm 0 0
//192.168.1.xx/roon_music /mnt/roon_music cifs guest,sec=ntlm 0 0
//192.168.1.xx/media-backup /mnt/media-backup cifs guest,sec=ntlm 0 0
192.168.1.xx = your SMB server
I used “music” for music files I originally organized using Mp3tag. “roon_music” can be any unorganized files you can dump for
Roon to organize. Media-backup is where to backup the Roon database.
###############################################################
Reboot just to make sure you’ll get the Arch Linux login screen
###############################################################
# reboot
(At this point, you can use putty to access Roon Server remotely from your desktop.)
###################
Install Roon Server
###################
# curl -O http://download.roonlabs.com/builds/roonserver-installer-linuxx64.sh
# chmod +x roonserver-installer-linuxx64.sh
# ./roonserver-installer-linuxx64.sh
Access the site through Roon Remote. In case the music server is not visible when accessed through your browser, reboot it.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment