Thursday, 26 April 2018

Introduction to installing Ubuntu on a mini PC


With Ubuntu 18.04 (Bionic Beaver) now released I thought I'd document a couple of features that are available and how to install the release both as a dual boot (e.g. along side Windows) and as an entire disk (single boot) installation.

Your starting point will be to download the official Ubuntu ISO (http://releases.ubuntu.com/bionic) and you will need the 64-bit desktop ISO (ubuntu-18.04-desktop-amd64.iso [current]).

Depending on your device it may be first be necessary to respin the ISO using my isorespin.sh script in order to boot and install (see Customizing Ubuntu ISOs: Documentation and examples of how to use 'isorespin.sh' for full details).

Once you have your ISO it is necessary to write it to an USB to create an installation USB often known as a LiveUSB as not only can you install Ubuntu from it but you can also run Ubuntu for diagnostic, testing and fixing and existing installation.

There are several ways to write the ISO to USB however I recommend using Rufus on Windows:


or dd on Linux:
dd if=ubuntu-18.04-desktop-amd64.iso of=/dev/sdX bs=4M
(where 'ubuntu-18.04-desktop-amd64.iso' is your ISO and  'sdX' is the USB drive)
(using 'ls -l /dev/disk/by-id/usb* | head -1 | sed "s?.*/??"' to determine this) 
Typically you will either want to:
and I've written a post for each.

Please donate if you find these guides useful using the following link http://goo.gl/nXWSGf.








22 comments:

  1. Hi, On ezbook 3 pro wi-fi don't work. I test it in "try ubuntu" mode. Can you help me?

    ReplyDelete
    Replies
    1. Use 'pastebinit' of a 'dmesg' log after booting to post something that can be diagnosed.

      Delete
  2. Hi,

    First of all I'd like to really thank you for all the great job you've done with the script. This is just pure gold. :-)
    I know this "community" (gathered around linuxium blog) is not the only one using the respinning script cause people are using this to get linux distros even on tablets. Hopefully you get what you deserve (donations).

    I wanted to ask you for help with my PC Stick. It's not purely Intel PC Stick but one of those "branded" ones where inside it's actually pretty much the same stuff as Intel PC Stick. Mine is running on Intel Atom Bay Trail-CR Z3735F with 2GB of RAM, 32GB of Flash & Win10. I've been playing with this for a while already and last year tested a respinned version of lubuntu 16.04. No problems with getting the ISO and running live env. on this. I didn't install it because I wanted to wait for lubuntu 18.04. Now was the time to say Win10 "bye bye". Funny to say - latest Win10 update killed Audio & WiFi so it was final "deal braker" anyway. :-)

    I took 64-bit lubuntu 18.04 iso from the i-net, got all install scripts for UCM & Broadcom toghether with wrappers + took rtl8723bs_4.12.0_amd64.deb and tried to respin this several times using last year's script version 7.3.4 and latest one 8.1.6 - with no success. I get errors like:

    Selecting previously unselected package rtl8723bs.
    (Reading database ... 127671 files and directories currently installed.)
    Preparing to unpack rtl8723bs_4.12.0_amd64.deb ...
    Unpacking rtl8723bs (4.12.0) ...
    dpkg: error processing archive rtl8723bs_4.12.0_amd64.deb (--install):
    trying to overwrite '/lib/firmware/rtlwifi/rtl8723bs_bt.bin', which is also in package linux-firmware 1.173
    dpkg-deb: error: paste subprocess was killed by signal (Broken pipe)
    Errors were encountered while processing:
    rtl8723bs_4.12.0_amd64.deb
    Reading state information... Done
    ./isorespin.sh: Local package 'rtl8723bs_4.12.0_amd64.deb' failed to install correctly.

    or sometimes I also get:
    Local package 'rtl8723bs_4.12.0_amd64.deb' is not compatible with version of installed 'linux-firmware' package.

    I guess this is caused by the fact that drivers are already there with kernel ver >4.12 but still this should be working fine. Also i'm adding '--atom' and sometimes it won't allow me to respin with errors. If I manage to respin this using several different kernels (from 4.13 to 4.17-rc5) I may be getting either BT and WiFi not working (no device found) or BT working (but seems to be dead anyway) and WiFi not working at all...When I put my last year's respined lubuntu 16.04.2 - works like a charm. Tried Peppermint with no success either. Help pls... :-|

    ReplyDelete
  3. I'll try several more kernels and get this through respin part and booting live env (with BT working at least). Than provide some more details so that you could give me some clue how to get WiFi working. I can always get some WiFi dongle but it's really last option I consider right now as kernel 4.12 on lub16.04 was working just fine.

    Linuxium - just one more question here. Why when I respin with '-k v4.12.14' it won't get this kernel but skip right away to 4.13 series? Is it because of "Lenovocase"? :-)

    ReplyDelete
    Replies
    1. The 'rtl8723bs' package errors are caused by miss-matching the package with the userland you are respinning. Using the '--atom' will work out the required dependencies. Which ISO are you trying to respin and is there a specific kernel you want to run or are you just wanting to get wifi, bt and hdmi audio working with the ISO?

      Delete
    2. Well I really don't care about specific version of kernel. I don't even think it makes such a huge difference whether I'm on 4.12 or 4.13 or whatever. All I want to get is to have a WiFi and Audio working after respinning ISO so that I'm able to purge W10 and install lubuntu 18.04 without any issues and everything working from the 1st boot. I'm trying to respin 64-bit version of lubuntu 18.04 LTS with both without and with '-u' flag and --atom flag (without rtl and wrappers etc. as I assume --atom has it already looking at LOG files) and what I get is booting live env. of lubuntu witho no wifi atapter detected. Didn't have a chance to check HDMI audio but this is something which I can always do later on.

      Honestly I thought 18.04 will work with no problem cause 16.04 worked and works like a charm. I still have the respinned 16.04 but it's gonna be supported till Apr 2019 that's why I'm trying to get 18.04 alive. :-)

      Delete
    3. Use the 'atom' Ubuntu 18.04 from 'http://linuxminipcs.com/ubuntu-18-04-lts-bionic-beaver' and post a link to your 'dmesg' after booting if wifi still doesn't work after doing a 'sudo systemctl start rtl8723bsbt.service' first.

      Delete
    4. OK. Did a dd (disk destroyer :o) ) for proposed ubuntu18.04. After booting no BT device and WiFi device is not detectable. I typed:

      sudo systemctl start rtl8723bsbt.service

      This didn't work and I've got some status message:
      https://pastebin.com/XQx2wHdU
      Also below you'll find 'dmesg':
      https://pastebin.com/3RvKTFNW

      Appreciate your help with this.

      Delete
    5. You have a Broadcom wifi chip not a Realtek one which explains the lack of wifi.

      Running the command:

      ls /sys/firmware/efi/efivars | grep nvram

      should show the something like:

      nvram-74b00bd9-805a-4d61-b51f-43268123d113

      so then copy this file:

      sudo cp /sys/firmware/efi/efivars/nvram-74b00bd9-805a-4d61-b51f-43268123d113 /lib/firmware/brcm/brcmfmac43430a0-sdio.txt

      and then reload wifi:

      sudo modprobe -r brcmfac
      sudo modprobe brcmfmac
      sudo systemctl start brcmbt.service

      If this works save the 'nvram' file as you should include it when respinning your ISO.

      I can't find out what audio your device (assuming you mean from a headphone jack) has so can you run the following commands:

      sudo apt install acpica-tools
      sudo cp /sys/firmware/acpi/tables/DSDT DSDT.dat
      sudo iasl -d DSDT.dat

      This will produce a file 'DSDT.dsl' which is a dump from your BIOS of a table that basically defines the hardware features of your device.

      Can you 'pastebinit' this file and post the URL?

      Delete
    6. I owe you some update. Thx for pointing out I've got Realtek - indeed I was knocking the wrong door. So what I've done so far is I've tried to run proposed command 'ls /sys/firmware/efi/efivars | grep nvram' but this didn't give me any result. There's no 'nvram' file whatsoever there. I didn't give up and went back to W10 and managed to fix WiFi after April update. Also what I did was I've found drivers responsible for this chip. Those were localized under c:\windows\system32\drivers folder:

      43430r0nvram.txt
      43430r0rtecdc.bin
      43430r1nvram.txt
      43430r1rtecdc.bin

      I've copied them. Than I've launched your respinned Ubuntu 18.04 and dropped 1st pair under /lib/firmware/brcm/ changing names to brcmfmac43430a0-sdio.txt & *.bin - Result was Wifi started and Ubuntu crashed. This didn't stop me cause it was already a success. So I've dropped my own respinned LUBUNTU 18.04 with 4.13.16-generic kernel. Tried to do the same but...

      I've found out the file brcmfmac43430a0-sdio.bin is there but TXT IS MISSING! So I've taken 43430r0nvram.txt from W10, dropped it under /lib/firmware/brcm changing name to brcmfmac43430a0-sdio.txt. WiFi started and works gorgeous. :-)

      Even BT started after doing service restart but cannot detec any hardware. Still I don't care about BT so much. Will follow this path checking audio shortly and provide further update. :-)

      Now the BIG QUESTION comes to surface. Probably I need to respin LUBUNTU from scratch with W10 43430r0nvram.txt included. How can I achieve this? There's a flag for this right? How can I force the script to copy local file into /lib/firmware/brcm changing it's name to fill the missing piece of Broadcom driver.

      Appreciate your help. Thx.

      Delete
    7. You use a combination of the '-f' and '-c' options:

      isorespin.sh -i lubuntu-18.04-desktop-amd64.iso --atom -f 43430r0nvram.txt -c "mv /usr/local/bin/brcmfmac43430a0-sdio.txt /lib/firmware/brcm"

      Delete
    8. Thx for the script. You forgot to mention the name has to be renamed before actually respinning the ISO but I've figured that out.

      The status with my PCStick is as follows:
      - WiFi works thanks to nvram file taken from W10 (missing txt in /lib/firmware/brcm).
      - HDMI AUDIO works out of the box so no problem at all.
      - BT doesn't work but I don't really care.

      After respinning lubuntu 18.04 I've went to live env and installed the system purging W10. Some thoughts after 2 days of using PCStick:
      - One of the EFI partitions owned by W10 seems to be untouchable by Linux installer. I can still see some W10 option in GRUB but I've hidden GRUB manu anyway.
      - Linux distribution boots and is fully operational but still I get strange issues.

      First thing while watching some mp4 file under VLC Linux just freezed. Only hard reset was possible. This freezing happened 3 times already but once by pressing "turn on/off" key on PCStick unfrozen it.

      Another issue was when watching mp4 via gnomeMPV, once I've switched off the player (gnomeMPV) I've lost HDMI on the spot but PCStick was running. I've managed to connect to it via remote desktop and operate normally but restart was necessary to bring the screen back to life.

      I guess something is not right with drivers or energy saving setup (everything switched off).

      Last issue I've had was linked to temperature. probably I've stressed the CPU too much cause it just got frozen and entire PCStick was quite hot I would say. Standard temp I get now is around 60*C on each core while 90*C is critical - did u have any issues with temp earlier?

      Delete
    9. Looks like my cut&paste was off!

      isorespin.sh -i lubuntu-18.04-desktop-amd64.iso --atom -f 43430r0nvram.txt -c "mv /usr/local/bin/43430r0nvram.txt /lib/firmware/brcm/brcmfmac43430a0-sdio.txt"

      The Intel compute sticks have fans which are quite effective for cooling. Is your PCStick passively cooled then?

      Delete
    10. Yep - it's passive. :-) Still it was getting hot under W10, but I guess the performance would than go down drastically. Here It's gonna freeze and that's it.

      But I wouldn't consider temp. as a key issue driver here. I have one xrandr crash file under /var/crash so if I get this right one freeze was caused by this not the temp.

      Delete
    11. If you can point a small fan on the device and visibly see that temperature decreases from your standard 60*C to say 50*C you can then test under load to see if temp is a factor. It is not just the CPU affected by temp but also memory, VRs etc so a high internal temp maybe causing instability elsewhere. Try removing the device from the case and together with the fan see if it becomes stable under load.

      Delete
    12. Update. What I did was to get some sensors packages running under lubuntu for approx. 48hrs. I left the PCStick idle during that time and setup screen turn-off time out to 30 minutes.

      The outcome is I've noticed the avg. temp. of computer left idle that wasy was close to 40*c but still slightly below. This eliminates the 1st case that it's overheating itself just because it's on Linux.

      What I'll do next will be to get a script sending sensors output to txt files each 10 sec. and than get the PCStick reeeeaaaaly busy. If it crashes at least I'll have something we can stick to.

      I don't know whether I can monitor RAM and Flash temp on this little machine - I guess not so this is best I can have. I mean I can always get the temp manually but let's just leave this option as a "life/death scenario"... :-)

      Delete
    13. Another update. I will use this article and discussion with Linuxium just in case anyone found my "journey to Linux on PCStick" useful... :-)

      Linuxium, I've managed to check that actually device temperature is not the thing causing lubuntu to freeze from time to time. It happened lately twice with temp being below 50*C but with running Teamviewer and also during night when it was completely idle... I've been trying to stress the CPU and GPU very hard reaching almost 80*c and it simply didn't crush at all... So what I did next was to put 'dmesg -wH', sensors (with WATCH prefix) and also 'tail' for syslog and X server logs... Guess what... Zero, zilch, zip, nada, nothing. It won't give me a reason why it freezes.

      Since I'm running this on kernel 4.15.0-20-generic I'm considering either respinning this with different versions or switching distro to Peppermint or other lightweight and trying out.

      Whould this even make a difference? I don't know what else can I check to get the root cause of the issue. Apart from this misterious freezing it works stable and solid. :-)

      Delete
    14. Try using 'GRUB_CMDLINE_LINUX_DEFAULT="intel_idle.max_cstate=1"' in your '/etc/default/grub' and running 'sudo update-grub' and if that doesn't solve it try with a value of zero as @Oliver Smith suggests below.

      Delete
    15. Few weeks passed and finally I can say - I've found the root cause. This is somehow strange but right after removing VLC (purge + autoremove) no freezes. Uptime for over 10-14 days without any issues. Probably some dependencies were causing the system to go mad. So right now I'm on Lubuntu 18.04 full time working like a charm. Thx!

      Now it's time to move to more ambitious project of bringing Linux to Asus Transformer Book T100HA. That should be fun... :-)

      Delete
  4. Maybe you need to add cstates command to grub.
    $ GRUB_CMDLINE_LINUX_DEFAULT="intel_idle.max_cstate=0"

    ReplyDelete
  5. This comment has been removed by a blog administrator.

    ReplyDelete
    Replies
    1. FYI I have a policy:

      "I've not verified the link so the comment has been removed as editing is not possible."

      where I remove comments that include links.

      Delete