Ubuntu 18.04 on Beelink Gemini J45 Mini PC (Fix and Review)

When I recently reviewed the Beelink J45 (aka Beelink Gemini J), a mini PC that uses the slightly older Intel Apollo Lake Pentium J4205 processor, whilst Windows 10 Pro ran fine it was unsuitable for Ubuntu because after installation the system became unstable and problems were encountered when running anything that loaded the system. The main issue was that when connected via wired-ethernet performing a command like ‘sudo apt upgrade’ would cause the ethernet to drop after which only a reboot would restore the connection. At the time it, was unclear what the cause was however a solution to the issue was posted by ‘gambetta’ on the Beelink forum. Basically it consists of installing the r8168 module which is the Linux device driver released for RealTek RTL8168B/8111B, RTL8168C/8111C, RTL8168CP/8111CP, RTL8168D/8111D, RTL8168DP/8111DP and RTL8168E/8111E Gigabit Ethernet controllers with PCI-Express interface. To paraphrase the ‘README.Debian’ file, you use ‘r8168-dkms because the in-kernel r8169 does not support your NIC or is not working properly’. So the commands to install this driver are:


You will notice that this includes an ‘apt update’ command that may cause the ethernet to drop so you might need to reboot and re-enter the commands until successful. Alternatively, you can use my “isorespin.sh” script to respin an Ubuntu ISO (e.g. Ubuntu 18.04.3) with the options --boot GRUB-64 --package r8168-dkms and use the resulting ISO to install Ubuntu.

As a reminder here is the performance of the mini PC under Windows when compared with other Intel mini PCs:

Windows Mini PC Benchmarks Comparison
Click to Enlarge

As usual, I shrunk the Windows partition and created a new partition so I could then install and dual boot Ubuntu using my respun Ubuntu 18.04.3 ISO.

After installation, a brief check showed everything was now working including Ethernet together with WiFi, Bluetooth, and audio. I then ran some basic commands to look at the hardware in more detail:


I next ran my standard Phoronix Test Suite benchmarks and the results can be compared with those from the previous testing on other mini PCs:

minipc-j45-systems
Click to Enlarge
Beelink J45 phoronix benchmarks
Click to Enlarge

As the full results might be a little confusing because for some tests, higher is better, whereas for others, lower is better, the following bar chart may be easier to understand:

beelink J45 benchmark charts
Click to Enlarge

I’ve then run ‘sbc-bench’ which is a small set of different CPU performance tests focusing on server performance, ‘glmark2’ from the standard repositories which is a benchmark for OpenGL (ES) 2.0, some real-world timing tests for the compilation, zipping and unzipping of the Linux mainline v5.2 kernel, ‘iozone’ also from the standard repositories which is a filesystem benchmark tool and finally ‘Octane 2’ which is a JavaScript benchmark and was run in Chrome.

Beelink J45 Octane 2.0 Ubuntu
Click to Enlarge

A summary of the results from each of the above benchmark tests was compared with previously tested mini PCs as follows:

Ubuntu Linux Mini PCs Comparison Table
Click to Enlarge

The performance is as expected compared to the slightly more powerful Gemini Lake mini PCs.

I also tested Geekbench 4:

AZW Gemini J45 GeekBench 4and ran the UNIGINE Heaven benchmark:

Beelink Gemini J45 Unigine-Heaven Benchmark Ubuntu

For real-world testing, I played videos in Firefox, Chrome and Kodi in Ubuntu. The results were very similar with other mini PCs and the following tables summarise the tests and results for each of web browsing, Kodi in general and Kodi playing specific videos:

Beelink J45 ubuntu web browser Beelink J45 kodi ubuntu Beelink J45 kodi specific

Overall the device performance is as expected in Ubuntu once the RealTek Linux device driver is loaded. Again I’d like to thank Beelink for providing the Gemini J45 for review. It currently retails at around $250 for the tested configuration (8GB RAM, 512GB SSD) on Aliexpress.

Share this:
FacebookTwitterHacker NewsSlashdotRedditLinkedInPinterestFlipboardMeWeLineEmailShare

Support CNX Software! Donate via cryptocurrencies, become a Patron on Patreon, or purchase goods on Amazon or Aliexpress

ROCK 5 ITX Rockchip RK3588 mini-ITX motherboard

9 Replies to “Ubuntu 18.04 on Beelink Gemini J45 Mini PC (Fix and Review)”

  1. Thank you for providing the fix (and also benchmarks and isorespin.sh in general)!

    Can you please also provide output from ethtool -i enp1s0 to maybe get a clue why this NIC doesn’t work with Ubuntu’s default drivers?

    1. Thanks. Here’s the output you requested. Booting a ‘dist-upgrade’ Ubuntu 18.04.3 ISO with only ‘ethtool’ installed means that the default r8169 ethernet driver was used:

      ubuntu@ubuntu:~$ lsmod | grep r81
      r8169 86016 0
      ubuntu@ubuntu:~$ ethtool -i enp1s0
      driver: r8169
      version:
      firmware-version: rtl8168h-2_0.0.2 02/26/15
      expansion-rom-version:
      bus-info: 0000:01:00.0
      supports-statistics: yes
      supports-test: no
      supports-eeprom-access: no
      supports-register-dump: yes
      supports-priv-flags: no
      ubuntu@ubuntu:~$

      whereas booting a ‘dist-upgrade’ Ubuntu 18.04.3 ISO with ‘r8168-dkms’ and ‘ethtool’ installed uses the RealTek r8168 ethernet driver:

      ubuntu@ubuntu:~$ lsmod | grep r81
      r8168 524288 0
      ubuntu@ubuntu:~$ ethtool -i enp1s0
      driver: r8168
      version: 8.045.08-NAPI
      firmware-version:
      expansion-rom-version:
      bus-info: 0000:01:00.0
      supports-statistics: yes
      supports-test: no
      supports-eeprom-access: no
      supports-register-dump: yes
      supports-priv-flags: no
      ubuntu@ubuntu:~$

      1. So basically it’s mainline with firmware vs firmware-less out-of-tree. I’ve had a look at changes to the r8169 driver between 5.0 and 5.4, and there are indeed a number of fixes for the 8168 (failures after resume, EEE registers, MSI, issues with HW csum, power saving etc). It would be interesting to know if 5.4-stable fixes the issue or not.

        Also, Ian, please do not forget to pass “-nn” to lspci so that it displays the PCI IDs in addition to the description. That allows to spot relevant changes in drivers.

        1. I respun the Ubuntu 18.03.4 ISO with the v5.4.3 kernel (from https://kernel.ubuntu.com/~kernel-ppa/mainline) and this did seem to fix the problem as booting the standard Ubuntu 18.03.4 ISO with its default kernel (5.0.0-23-generic) still replicated the problem. My testing wasn’t extensive though as it merely consisted of booting the v5.4.3 ISO and successfully performing an ‘apt update && apt upgrade’ then booting the standard ISO and watching the ‘apt upgrade’ fail and then repeating both boots to confirm the results. The ‘ethtool’ output using the v5.4.3 kernel doesn’t change:

          ubuntu@ubuntu:~$ uname -a
          Linux ubuntu 5.4.3-050403-generic #201912130841 SMP Fri Dec 13 08:43:59 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
          ubuntu@ubuntu:~$ lsmod | grep r81
          r8169 90112 0
          ubuntu@ubuntu:~$ ethtool -i enp1s0
          driver: r8169
          version:
          firmware-version: rtl8168h-2_0.0.2 02/26/15
          expansion-rom-version:
          bus-info: 0000:01:00.0
          supports-statistics: yes
          supports-test: no
          supports-eeprom-access: no
          supports-register-dump: yes
          supports-priv-flags: no
          ubuntu@ubuntu:~$

          As you point out the 5.4 kernel does include a fair few changes to the r8169 driver (I previously tried the v5.3 kernel) and I noticed that several of these new changes were to do with aligning to ‘the vendor driver’ although it is not obvious which change(s) has made the difference.

          I also do capture the command ‘lspci -nn’ in my test scripts along with ‘lspci -vvv’ however I just report the output of ‘lspci’ in my reviews. The ‘lspci’ command with PCI vendor and device codes is:

          linuxium@J45:~$ lspci -nn
          00:00.0 Host bridge [0600]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Host Bridge [8086:5af0] (rev 0b)
          00:00.1 Signal processing controller [1180]: Intel Corporation Device [8086:5a8c] (rev 0b)
          00:02.0 VGA compatible controller [0300]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Integrated Graphics Controller [8086:5a84] (rev 0b)
          00:03.0 Multimedia controller [0480]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Imaging Unit [8086:5a88] (rev 0b)
          00:0e.0 Audio device [0403]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Audio Cluster [8086:5a98] (rev 0b)
          00:0f.0 Communication controller [0780]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Trusted Execution Engine [8086:5a9a] (rev 0b)
          00:12.0 SATA controller [0106]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SATA AHCI Controller [8086:5ae3] (rev 0b)
          00:13.0 PCI bridge [0604]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port A #1 [8086:5ad8] (rev fb)
          00:14.0 PCI bridge [0604]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series PCI Express Port B #2 [8086:5ad7] (rev fb)
          00:15.0 USB controller [0c03]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series USB xHCI [8086:5aa8] (rev 0b)
          00:1c.0 SD Host controller [0805]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series eMMC Controller [8086:5acc] (rev 0b)
          00:1f.0 ISA bridge [0601]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series Low Pin Count Interface [8086:5ae8] (rev 0b)
          00:1f.1 SMBus [0c05]: Intel Corporation Celeron N3350/Pentium N4200/Atom E3900 Series SMBus Controller [8086:5ad4] (rev 0b)
          01:00.0 Ethernet controller [0200]: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller [10ec:8168] (rev 15)
          02:00.0 Network controller [0280]: Intel Corporation Wireless 3165 [8086:3165] (rev 81)
          linuxium@J45:~$

      2. > driver: r8169
        > version:
        > firmware-version: rtl8168h-2_0.0.2 02/26/15

        I was comparing with ODROID H2 where it looked like this:

        Still wondering why some modern RTL8111 variants work out of the box and some need RealTek’s r8168 driver…

        1. Yours uses a different MAC. According to the driver, Ian’s is RTL_GIGA_MAC_VER_46 while yours seems to be RTL_GIGA_MAC_VER_40. There’s a significant list of different code paths in the driver for them in 5.4 so this indeed explains the problems with earlier versions and why 5.4 fixes them.

          1. It is commit a7a92cf81589 (r8169: sync PCIe PHY init with vendor driver 8.047.01) that fixes the problem for the Beelink J45 and in particular the following change:

            - { 0x04, 0xffff, 0x154a },
            + { 0x04, 0xffff, 0x854a },

            In fact this is all that is needed as I recompiled the Ubuntu HWE kernel 5.0.0-23-generic (Ubuntu-hwe-5.0.0-23.24_18.04.1) which is the kernel used in the Ubuntu 18.04.3 ISO and only changed ‘0x154a’ to ‘0x854a’ and then respun the ISO with the new kernel and was able to boot and successfully perform an ‘apt update && apt upgrade’ which I couldn’t do when booting the standard ISO as the ‘apt upgrade’ fail. I confirmed the results by repeatedly booting the unspun ISO which would fail and the respun ISO with the patched kernel that succeeded.

          2. Great, now you just have to file a report to ubuntu so that they include this in their kernel 🙂

          3. Just for completeness I had a look at the source for ‘r8168-dkms’ and the Beelink J45 uses CFG_METHOD_30 which has the same updated value:

            rtl8168_ephy_write(ioaddr, 0x04, 0x854A);

            So using this r8168 module and then upgrading to Ubuntu 20.04 (Focal Fossa) which is slated to use the v5.5 kernel will probably be quicker than me raising any bug in Launchpad!

Leave a Reply

Your email address will not be published. Required fields are marked *

Boardcon Rockchip RK3588S SBC with 8K, WiFI 6, 4G LTE, NVME SSD, HDMI 2.1...
Boardcon Rockchip RK3588S SBC with 8K, WiFI 6, 4G LTE, NVME SSD, HDMI 2.1...