From nobody Sun Jul 21 19:44:41 2024 X-Original-To: freebsd-virtualization@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WRv504zSbz5QMkL for ; Sun, 21 Jul 2024 19:44:52 +0000 (UTC) (envelope-from hartzell@alerce.com) Received: from corvid.alerce.com (corvid.alerce.com [206.125.171.163]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4WRv4z62YFz47YM for ; Sun, 21 Jul 2024 19:44:51 +0000 (UTC) (envelope-from hartzell@alerce.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=alerce.com header.s=dkim header.b=urYkYxJJ; dmarc=pass (policy=none) header.from=alerce.com; spf=pass (mx1.freebsd.org: domain of hartzell@alerce.com designates 206.125.171.163 as permitted sender) smtp.mailfrom=hartzell@alerce.com Received: from postfix.alerce.com (unknown [65.130.18.255]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by corvid.alerce.com (Postfix) with ESMTPSA id 712A9F0BE0 for ; Sun, 21 Jul 2024 12:55:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alerce.com; s=dkim; t=1721591721; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T9pJiB5g4lvCmDZFqCdMMA+Kdd4xndc//nnwrnX75YM=; b=urYkYxJJce1e+Jk6T5INOWwLT59i1jkwSGxPPOfJcYz1Q8BIkbGVZu5vQe7P+0cGA8l94A UT6fxUnitdHuRoXz5YUwEl0daDzF5WDlc1YEoDVC2LxBfG+SzEjdkKitdKst7Tr7s8qLAh Rvv/tkpTfFQGVMxkadaGQdmhuUESHa4NMQz+M0HAifzJqnfEr1quy4uUybCh2jQAKsDRQ1 oyWgbr3rfql9UQOy8FKsUQvRJqyl2/p3Z1EucxxTRQBEB2aoyLPyTwOcPEsYAdPnSA+k4U Y1H6ek0W2wzlPTV/tLqi75jVksadb5WqQZ4GE3jL+vPshZWyB/RvYoxx/gDEfA== Received: by postfix.alerce.com (Postfix, from userid 502) id E26A933DB0B2; Sun, 21 Jul 2024 13:44:41 -0600 (MDT) From: George Hartzell List-Id: Discussion List-Archive: https://lists.freebsd.org/archives/freebsd-virtualization List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-virtualization@freebsd.org Sender: owner-freebsd-virtualization@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <26269.25897.876377.311179@gargle.gargle.HOWL> Date: Sun, 21 Jul 2024 13:44:41 -0600 To: freebsd-virtualization@freebsd.org Subject: Re: Problem with TinyCore Linux in Bhyve in TrueNas In-Reply-To: <26232.44448.864451.216491@gargle.gargle.HOWL> References: <26232.44448.864451.216491@gargle.gargle.HOWL> X-Mailer: VM undefined under 29.1 (aarch64-apple-darwin23.1.0) Reply-To: hartzell@alerce.com X-Spamd-Bar: --- X-Spamd-Result: default: False [-4.00 / 15.00]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[alerce.com,none]; R_SPF_ALLOW(-0.20)[+mx]; R_DKIM_ALLOW(-0.20)[alerce.com:s=dkim]; MIME_GOOD(-0.10)[text/plain]; ARC_NA(0.00)[]; ASN(0.00)[asn:25795, ipnet:206.125.168.0/21, country:US]; RCVD_VIA_SMTP_AUTH(0.00)[]; MIME_TRACE(0.00)[0:+]; RCPT_COUNT_ONE(0.00)[1]; MLMMJ_DEST(0.00)[freebsd-virtualization@freebsd.org]; RCVD_TLS_LAST(0.00)[]; REPLYTO_ADDR_EQ_FROM(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; HAS_REPLYTO(0.00)[hartzell@alerce.com]; RCVD_COUNT_TWO(0.00)[2]; TO_MATCH_ENVRCPT_ALL(0.00)[]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-virtualization@freebsd.org]; DKIM_TRACE(0.00)[alerce.com:+] X-Rspamd-Queue-Id: 4WRv4z62YFz47YM 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 - [x] 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