Using Lima’s Fedora VM + NCDU

 

Intro Cockpit 20231218 102441 2

Once the VM has been installed and executed the bash scripts, it is time to fire up Cockpit.

Note While a Lima-based Cockpit is accessed via port 9090, in an ideal world any and all Cockpits configured on your server whether they be on the metal or in a VM should be accessed via SSH - usually on port 22.

Getting started with Cockpit

In addition Lima does not allow a public accessible IPv6 address. If you are trying to reach your IPv6 SHES server from a remote location, you will either need to have a computer running Linux with Cockpit on the metal or in a VM (like a MBA) OR use a VNC client app that allows you to connect to a remote VNC server via SSH assuming the server has an open port 22 and an accessible IPv6 address.

In addition Lima does not allow a public accessible IPv6 address. If you are trying to reach your IPv6 SHES server from a remote location, you will either need to have a computer running Linux with Cockpit on the metal or in a VM (like a MBA) OR use a VNC client app that allows you to connect to a remote VNC server via SSH assuming the server has an open port 22 and an accessible IPv6 address.

In addition Lima does not allow a public accessible IPv6 address. If you are trying to reach your IPv6 SHES server from a remote location, you will either need to have a computer running Linux with Cockpit on the metal or in a VM (like a MBA) OR use a VNC client app that allows you to connect to a remote VNC server via SSH assuming the server has an open port 22 and an accessible IPv6 address.

To access Cockpit running on the Mac you are using without bridge mode point your browser to https://locahost. Or – in bridge mode – https://local-ip-address. If you are intending to access Cockpit on another local Mac which is in bridged mode that you presumably are connected to via SSH, enter the VM’s shell and enter the ip address command to retrieve the IP address as follows:

$ ssh user@vm-host
vm-host $limactl shell vm-name
vm-host vm-name $ ip address show lima0

Login to Cockpit

Because

Upload another bash script to install more utilities.

#!/bin/bash
dnf -y install bpytop
dnf -y install bandwhich
dnf -y install ranger 
dnf -y install hdparm
dnf -y install mc 
dnf -y install ncdu
dnf -y install grsync
dnf -y install blivet-gui 
dnf -y install btop
dnf -y install nmap
dnf -y install wget
dnf -y install lshw
dnf -y install borgmatic

dnf -y install bpytop dnf -y install bandwhich dnf -y install ranger dnf -y install hdparm dnf -y install mc dnf -y install ncdu dnf -y install grsync dnf -y install blivet-gui dnf -y install btop dnf -y install nmap dnf -y install wget dnf -y install lshw dnf -y install borgmatic dnf -y groupinstall Editors dnf -y install switchdesk switchdesk-gui dnf -y install duf dnf -y install btrfs-assistant dnf -y install vorta dnf -y install NetworkManager-tui dnf -y install gnome-system-monitor dnf -y install gnome-disk-utility dnf -y install tuned systemctl start tuned systemctl enable tuned dnf -y install deja-dup dnf -y install bash-color-prompt dnf -y groupinstall "LXQt" dnf -y groupinstall "Applications for the LXQt Desktop" 

Uploading is simple with Cockpit.

BTW many (but not all) of these utilities can also be installed directly in MacOS with are old friend Brew. Let’s look up ncdu on Brew. First of all what is ncdu? Just ask The Fedora

$ dnf info ncdu
Last metadata expiration check: 1:04:30 ago on Mon 11 Mar 2024 06:04:02 AM CET.
Installed Packages
Name         : ncdu
Version      : 1.19
Release      : 1.fc39
Architecture : x86_64
Size         : 111 k
Source       : ncdu-1.19-1.fc39.src.rpm
Repository   : @System
From repo    : fedora
Summary      : Text-based disk usage viewer
URL          : https://dev.yorhel.nl/ncdu/
License      : MIT
Description  : ncdu (NCurses Disk Usage) is a curses-based version of the well-known 'du',
             : and provides a fast way to see what directories are using your disk space.

Here it is at work…

ncdu 1.19 ~ Use the arrow keys to navigate, press ? for help
--- / --------------------------------------------------------------------
  220.3 GiB [##########] /var
  129.1 GiB [#####     ] /root
    6.5 GiB [          ] /usr
  361.3 MiB [          ] /boot
   30.0 MiB [          ] /etc
   18.2 MiB [          ] /home
    2.1 MiB [          ] /run
    8.0 KiB [          ] /tmp
.   0.0   B [          ] /proc
    0.0   B [          ] /sys
    0.0   B [          ] /dev
    0.0   B [          ] /opt
    0.0   B [          ] /.ssh
@   0.0   B [          ]  lib64
@   0.0   B [          ]  sbin
@   0.0   B [          ]  lib
@   0.0   B [          ]  bin
e   0.0   B [          ] /srv
e   0.0   B [          ] /mnt
e   0.0   B [          ] /media
e   0.0   B [          ] /bkp-go
e   0.0   B [          ] /afs
*Total disk usage: 356.3 GiB   Apparent size: 128.4 TiB   Items: 809668

This is an image of the screen

As a result of the apex powers at Apple, ncduwould actually be a useful utility for the Mac. Let’s go to https://brew.io and see if it is available and how to install it. Enter ncdu in Brew’s Search box.

Brew will respond with a list of packages that match the search criteria. Click on it ncdu

Brew will provide all the information required to get started with installing and using ncdu.

Let’s go ahead and install it on the Mac and give it a try…

$ brew install ncdu
==> Downloading https://ghcr.io/v2/homebrew/core/ncdu/manifests/2.3
==> Fetching ncdu
==> Downloading https://ghcr.io/v2/homebrew/core/ncdu/blobs/sha256:7c17a54a1c133f106b8ccc577241b977d76de394568b838107c5c397291b6759
###################################################################################################################################### 100.0%
==> Installing ncdu
==> Pouring ncdu--2.3.arm64_sonoma.bottle.tar.gz
🍺  /opt/homebrew/Cellar/ncdu/2.3: 6 files, 574.0KB
==> Running `brew cleanup ncdu`...
Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP.
Hide these hints with HOMEBREW_NO_ENV_HINTS (see `man brew`).

# Get the sizes of the contents of the Documnts Folder:
$ ncdu ~/Documents

Getting Started

## Part 1 of Basic Tools series

See Introduction to Mac2Net.com

In [[Posted 1.0 What is Mac2Net?]] , I introduced the software components for operating SHES. In **Part 1, – Getting Started** I am going to introduce how to quickly get started with building Linux virtual machines just with a Mac. In this post, I will introduce the basic tools for running a similar system on MacOS (Intel or ARM - Apple Silicon).
### Brew.sh
Before running out and purchasing a new Mini PC, and these days there are powerful and affordable ones the market, let’s get started installing the Fedora, etc on the Mac. My suggestion is to first install [Brew.sh](https://brew.sh) , “**The Missing Package Manager for macOS (or Linux)**” .

With Brew, almost all the packages required to manage Self-Hosting services are available for MacOS with minimal to no impact on the Mac’s performance or disruption of one’s day to day use of Mac hardware. Brew can also install a few relevant GUI apps directly into the `/Applications` folder and by running `brew update` insure the machine has the latest versions.

### Lima
[LIma](https://lima-vm.io) is an open source software package developed primarily for MacOS to run lightweight Linux **virtual machines**. Lima is not opinionated – it offers templates for, as of this moment, 33 varieties of Linux and containers (more on containers later) as well as 12 experimental options and the ability for these templates to be modified according to one’s needs.

### Why run Lima on the Mac?
With Lima it is easy to install Fedora 39 Cloud Edition along with Cockpit in order to remotely manage Self-hosted edge services from a Mac using a web browser. Cockpit supports Cockpit-to-Cockpit connections over SSH (port 22) which basically means it is not necessary to open the Cockpit port (9090) on the bare metal server or any of the virtual machines in order to access it. This means it is easier to secure access to Cockpit from undesirables.

I usually run Lima on an Intel Mac Mini rather than my personal MacBook Air, although it is installed on this machine as well, in order to avoid it swallowing up precious heavily Apple-taxed Apple Silicon RAM – although through testing I learned that the actual RAM used when running in the background is relatively small. My Mac Mini has a bare minimum 128GB SSD and 64GB RAM, so there are a few more steps required in order to prevent Lima from clogging up my internal SSD which I will explain.

### What exactly is this ‘Cockpit’?

[Cockpit](https://cockpit-project.org) is the ultimate “it slices, it dices” tool to help you run your SHES. While other tools are still required, Cockpit is the fastest and most efficient way to manage a network and quickly investigate when unexpected situations occur, “what the hell is going on?”

### What’s the bottom line here?
Considering how one would manage hosted or cloud services, a Self-Hosted enthusiast is trading access to canned services for