WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Help installing TinyCore into a FreeBSD/Bhyve VM on TrueNAS  (Read 1273 times)

Offline hartzell

  • Newbie
  • *
  • Posts: 3
I have a TrueNAS Core NAS system running TrueNAS-13.0-U6.1 (a FreeBSD-based system).

I'm trying to install TinyCore Linux in a VM (TrueNAS provides a UI around bhyve, the FreeBSD vm system).

I've tried various images, just repeated the experiment with the 17MB Core image from
http://tinycorelinux.net/downloads.html (sha256: e2d98595cf62133df71516602c12aa685c6b4da19db3068d150e4946415d0d86  Core-current.iso).

When I run through the configuration menu, generally taking the
defaults, in particular choosing UEFI boot, I end up at the UEFI shell
menu (in both VNC and the serial shell window).

Trying the UEFI-CSM boot setting I end up with "connected" in the
serial console window but nothing and no response to the keyboard.

Trying grub boot setting gets me a message from the UI that says:

    > [EFAULT] Unable to find boot devices for '1_tc' domain

I've booted Alpine Linux in UEFI mode w/out any issues.

Any suggestions for next steps?

Thanks,

g.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14826
Re: Help installing TinyCore into a FreeBSD/Bhyve VM on TrueNAS
« Reply #1 on: June 27, 2024, 10:26:17 AM »
You could try the TinyCorePure64 ISO, which has the uefi boot files included.

Offline hartzell

  • Newbie
  • *
  • Posts: 3
Re: Help installing TinyCore into a FreeBSD/Bhyve VM on TrueNAS
« Reply #2 on: June 27, 2024, 04:54:38 PM »
Thank you!

That got me to a grub menu with tc, tcw, core, and corew boot choices.  I assume that tc is TinyCore and core is Core.  Not sure what the "w" versions are....

Onward!

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11654
Re: Help installing TinyCore into a FreeBSD/Bhyve VM on TrueNAS
« Reply #3 on: June 27, 2024, 05:33:54 PM »
Hi hartzell
Welcome to the forum.

If you check boot/isolinux/isolinux.cfg in the ISO you'll find:
Code: [Select]
LABEL tc
MENU LABEL Boot TinyCorePure64
TEXT HELP
Boot TinyCorePure64 with Embedded X/GUI extensions.
Boot media is removable. Use TAB to edit options for specific needs.

LABEL tcw
MENU LABEL Boot TinyCorePure64 (on slow devices, waitusb=5)
TEXT HELP
Boot TinyCorePure64 with Embedded X/GUI extensions, if using a slow device.
Boot media is removable. Use TAB to edit options for specific needs.

LABEL core
MENU LABEL Boot Core (command line only).
TEXT HELP
No embedded X/GUI extensions are loaded. User extensions scanned or specified
will be loaded, and will need to provide X/GUI if required.

LABEL corew
MENU LABEL Boot Core (command line only on slow devices, waitusb=5)
TEXT HELP
No embedded X/GUI extensions are loaded. User extensions scanned or specified
will be loaded, and will need to provide X/GUI if required.

The TEXT HELP for each selection should be displayed as you scroll
through the selections using the up/down arrows on your keyboard.

Offline hartzell

  • Newbie
  • *
  • Posts: 3
Re: Help installing TinyCore into a FreeBSD/Bhyve VM on TrueNAS
« Reply #4 on: July 21, 2024, 03:47:31 PM »
George Hartzell writes:
 >
 > I have a TrueNAS Core system running TrueNAS-13.0-U6.1.
 >
 > I'm trying to install TinyCore Linux in a VM.  [...]

Just wanted to follow up with a few notes after working all this out.
It's mostly straight-forward, do what you think you should, and _etc_.

The key bits are:

- Use the [TinyCorePure64] iso, it has the UEFI bits needed to boot
  up.
- Connect via VNC
- In grub, choose `core`, the window-system version (tc) would boot
  but I could never get the mouse/keyboard to respond in the VNC
  window.
- Use the virtio network device, not the Intel device.  The Intel
  device works for a bit, but when I would try to reconnect a VNC
  session the entire VM would get a sig 6 or 11.

For my future self's sake (and completeness), my notes boil down to:

## Set up a VM

- Grab a copy of the x86 Pure 64 port iso.  E.g. the [Core Pure 64
  Latest Build] and then [TinyCorePure64].  You need the
  `TinyCorePure64` ISO, not the `CorePure64...` ISO, the former
  includes necessary UEFI boot bits.

- Set up a VM using the TrueNAS GUI.  Most of the choices are
  "obvious", but definitely should have...
  - Guest Operating System: Linux
  - Boot Method: UEFI
  -
  • Enable VNC

  - NEXT
  - CPU bits, whatever, I took the defaults
  - NEXT
  - Create a new disk image, provide a ZVOL storage location and a
    size.
  - NEXT
  - Networking bits
    - Choose the virtio adapter, not the Intel.  The intel seems to
      cause the vm to crash when (at least) VNC reconnects.
  - NEXT
  - boot from the e.g. TinyCorePure64-15.0.iso image.  You might need
    to upload it from your laptop or otherwise get it into the TrueNAS
    filesystem.
  - NEXT
  - SUBMIT

## Start the VM

- Start it
- Choose the VNC console
- In grub, choose `core` (the `tc` choice sets up an X desktop, I
  couldn't figure out how to get it to listen to input...).
- You should now be at a shell prompt

## Load some useful tools (might not be minimal...)

- `tce-load -wi e2fsprogs dosfstools grub2-multi efibootmgr`

- `sudo fdisk /dev/sda` ...
- `sudo fdisk /dev/sda` -- goal is to create two partitions, first is a
  type `ef` (EFI) of ~0.5G, then a type `83` (linux) that uses the
  rest of the disk.

- Create some filesystems:
  - `sudo mkfs.vfat /dev/sda1`
  - `sudo mkfs.ext4 /dev/sda2`

- Mount them
  - `sudo rebuildfstab`
  - `sudo mount /dev/sda1`
  - `sudo mount /dev/sda2`

- Install the boot loader
  - `sudo grub-install --target=x86_64-efi --boot-directory=/mnt/sda1/EFI/BOOT --efi-directory=/mnt/sda1 --removable`

- Set up the tinycore bits
  - `mkdir /mnt/sda1/boot`
  - `mount /dev/sr0`
  - `cp /mnt/sr0/boot/* /mnt/sda1/boot`  # ignore warning about omitting a directory
  - `cp /mnt/sr0/EFI/BOOT/grub/grub.cfg /mnt/sda1/EFI/BOOT/grub/grub.cfg`
  - (optional) edit the `grub.cfg`, I removed useless entries... and
    added a `default=core` and `timeout=5`
  - `mkdir /mnt/sda1/tce`
  - `touch /mnt/sda1/tce/mydata.tgz`

- `sudo halt`

- Stop the VM, remove the CD device from the VM, then start it and reconnect to VNC.

- Et, viola!


[TinyCorePure64]: http://tinycorelinux.net/15.x/x86_64/release/TinyCorePure64-15.0.iso