Skip to content

Commit 78bfe66

Browse files
committed
Give more detailed instructions for creating a new VirtualBox VM
1 parent 276bda6 commit 78bfe66

File tree

1 file changed

+208
-1
lines changed

1 file changed

+208
-1
lines changed

notes/macos-virtualbox-ubuntu-install-notes.md

Lines changed: 208 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,217 @@ notes on installing a guest Linux VM on an Apple Silicon Mac using the
55
UTM application.
66

77

8+
# Install VirtualBox
9+
10+
Get it from https://www.virtualbox.org
11+
12+
I do not recall any difficulties in installing it on Windows 10, 11,
13+
or macOS. Thankfully the installer asks very few questions while
14+
installing it.
15+
16+
17+
# Finding the Linux installer image you want
18+
19+
Download the `.iso` file that installs the version of Linux that you
20+
are interested in. An Internet search for terms like these works for
21+
me. Use "amd64" for a host system with 64-bit Intel/AMD CPU, or
22+
"arm64" for an Apple Silicon Mac.
23+
24+
Example search terms:
25+
26+
+ Ubuntu 20.04 arm64
27+
+ Ubuntu 24.04 amd64
28+
29+
An installer for Desktop Linux leads to fewer steps you need to do in
30+
order to get a GUI Desktop. As of 2024, I have only been able to find
31+
Server Linux installers for arm64 systems. It is not difficult to
32+
install that, and then later install the GUI Desktop.
33+
34+
35+
# Creating a new VM
36+
37+
Start VirtualBox. While there are command line ways to do all of this
38+
with VirtualBox (I believe), I have never used those. The VirtualBox
39+
GUI takes a few minutes to use when creating a new VM, and installing
40+
the VM takes the computer a while longer. I estimate around 30 to 45
41+
minutes total time to create a new VM where you install Linux from an
42+
`.iso` file.
43+
44+
A nice thing about VirtualBox is that once you create a VM for the
45+
operating system you want, if you have enough free disk space to keep
46+
around that original VM, it is very quick (30 seconds or less) to
47+
create a copy of that VM, and then install a bunch of software on that
48+
copy. As long as you leave the original VM there, it will not change,
49+
and you can create copies of it whenever you want to try experimenting
50+
with it. Did you accidentally mess up the state of that VM's
51+
system-wide configuration files, or install some weird combination of
52+
software that seems to conflict with each other? You can abandon that
53+
VM image, deleting it whenever you no longer find its contents useful,
54+
and create more clones of the original base OS for further
55+
experiments.
56+
57+
In the VirtualBox GUI window:
58+
59+
+ Click the button "New"
60+
+ In the window that appears, give a unique name to your VM,
61+
e.g. "Ubuntu 24.04 base OS".
62+
+ Select the location of the `.iso` installer file that you
63+
downloaded.
64+
+ I prefer to check the box "Skip Unattended Installation", and these
65+
instructions will assume you are doing so, too.
66+
+ Under "Hardware" choose the amount of RAM, number of virtual CPUs,
67+
and hard disk space you want.
68+
+ In 2024, I rarely want to create a VM with less than 4 GBytes
69+
(4096 MBytes) of RAM. I typically select 4 processors, and 60
70+
GBytes of disk space. I do _not_ click the "Pre-allocate Full
71+
Size" check box, since then it would immediately create a file
72+
that was 60 GBytes in size. If you do not check that box,
73+
VirtualBox creates a disk image file that is only as large as it
74+
needs to be to store the files currently existing within the VM's
75+
file system, not the full size it might grow to later.
76+
+ Click the "Finish" button. This closes the window you were working
77+
on, and a new VM image with the name you gave it has now been
78+
created. It does not have the OS installed yet.
79+
+ Select that new image and click on the button "Settings".
80+
+ Click "General".
81+
+ Under the "Advanced" tab, change "Shared Clipboard" to
82+
"Bidirectional".
83+
+ Click "Display".
84+
+ Under the "Screen" tab, change "Video Memory" from 16 MB to 32 MB.
85+
+ If you want to create a shared folder on your host OS that is
86+
readable and writable from the guest OS, too, click "Shared Folder".
87+
+ Click on the icon that looks like a folder with a "+" symbol on it.
88+
+ Change "Folder Path" to choose the host OS folder you want to share.
89+
+ Check the box for "Auto-mount".
90+
+ If you want the guest OS to only be able to read this folder, but
91+
not write to it, check the box for "Read-only".
92+
+ Click "OK" button.
93+
+ Back in the main settings window for the VM image, click the OK
94+
button.
95+
96+
97+
# Common steps for starting any VM iamge, including a new installer one
98+
99+
+ Select the VM image and click the "Start" button.
100+
+ If the text is uncomfortably small for reading, select the
101+
VirtualBox menu item View -> Virtual Screen 1 -> Scale to 200%.
102+
Adjust the scale choice to your reading comfort.
103+
104+
105+
# Installation steps
106+
107+
These depend upon the particular guest OS that you are installing.
108+
109+
## Ubuntu Server 24.10
110+
111+
Choose language. See on-screen instructions for moving the choice
112+
around.
113+
114+
Choose keyboard language.
115+
116+
On the page "Choose the type of installation", I leave the default
117+
choice "Ubuntu Server" selected with an "X" as is. I press return for
118+
selecting "Done" at the bottom of the screen.
119+
120+
Network Configuration: press return for Done.
121+
122+
Proxy address: I do not need one for my home network, so press return
123+
for Done.
124+
125+
Ubuntu archive mirror configuration: Wait a few seconds for it to test
126+
access to the default mirror archive. Press return for Done, assuming
127+
that it successfully finds a mirror system to connect to.
128+
129+
Guided storage configuration: This can be nerve-wracking for a new
130+
user if you are installing multiple OS's on a physical system, but
131+
here we have created a new virtual disk just for this guest OS's full
132+
use, so we want to allocate all of that virtual disk for this OS's
133+
purposes. Leave the default "X" checked on "Use an entire disk".
134+
135+
I usually press tab until the cursor is on the "X" next to "Set up
136+
this disk as an LLVM group", and press the space key to uncheck that
137+
box. Press tab a couple more times to select "Done" near bottom of
138+
screen, then return to proceed.
139+
140+
Storage configuration: Look over the info on the screen if you are
141+
curious, but I just press return to proceed.
142+
143+
A "Confirm destructive action" "window" pops up. Again, this is where
144+
I get nervious if I am ever installing Linux on a physical system
145+
where I want another OS to remain on a different disk partition, but
146+
VirtualBox is restricting this VM so that it can only see the virtual
147+
disk(s) that VirtualBox created it, and nothing else in the host OS
148+
file system, so confidently proceed by pressing tab to highlight the
149+
"Continue" choice, and press return.
150+
151+
Enter your full name, desired system name, user name, password,
152+
etc. pressing tab to advance through the different boxes. When ready,
153+
press tab until "Done" is highlighted at the bottom, then press
154+
return.
155+
156+
SSH Configuration: I do not install an openSSH server, tab to
157+
highlight Done, and press return to continue.
158+
159+
Featured server snaps: I press tab until "Done" is highlighted at the
160+
bottom, then return to proceed, as none of the snaps presented are
161+
things I typically want to install. Any of them can be installed
162+
later after the base OS is installed, with appropriate install
163+
commands.
164+
165+
Updating system: This can take many minutes to complete. Grab a cup
166+
of coffee. Work on something else. Check back occasionally. You can
167+
tell this step is done when the top of the screen says "Installation
168+
complete!". Press tab to highlight "Reboot Now" near bottom of screen
169+
and press return to proceed.
170+
171+
If the screen says "Please remove the installation medium, then press
172+
ENTER:", just press return/enter key to proceed.
173+
174+
You will see many boot progress messages appear, and hopefully in
175+
under 1 minute you will see a login prompt that looks like:
176+
177+
```
178+
<your-system-name> login:
179+
```
180+
181+
Enter your user name and password to log in.
182+
183+
Update any of the base OS packages that have newer versions available
184+
with these commands:
185+
186+
```bash
187+
sudo apt update
188+
sudo apt upgrade
189+
```
190+
191+
Press return if prompted to confirm the installation of new packages.
192+
193+
If you want to install the default Ubuntu GUI desktop:
194+
195+
```bash
196+
sudo apt-get install ubuntu-desktop-minimal
197+
```
198+
199+
That downloads hundreds of MBytes of packages and installs them. When
200+
it is complete, enter the following command to reboot the system:
201+
202+
```bash
203+
sudo reboot
204+
```
205+
206+
It might "pause" during the boot messages for several minutes, before
207+
you see a GUI login window. See the section named "Installing desktop
208+
GUI on Ubuntu Server Linux" below for some commands you can run that
209+
disable a redundant network system service, one that significantly
210+
slows down the system boot process if you leave it enabled.
211+
212+
8213
# General notes on VM settings
9214

10215
[I have verified that these settings are the same in VirtualBox 6.x
11216
and 7.x running on a Windows 10/11 host OS, as well as many versions
12-
of macOS from 10.14.x and later as host.]
217+
of macOS, both Intel and Apple Silicon, from 10.14.x and later as
218+
host.]
13219

14220
System -> Motherboard -> Base Memory: While there might be uses for a
15221
Linux guest VM with only 1 GByte of RAM, I typically change that to 4
@@ -186,6 +392,7 @@ one installs less software, a bit faster and less storage required.
186392
The second one installs more software, such as LibreOffice.
187393

188394
```bash
395+
# You only need _one_ of these two commands.
189396
sudo apt-get install ubuntu-desktop-minimal
190397
sudo apt-get install ubuntu-desktop
191398
```

0 commit comments

Comments
 (0)