-
-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Max Roby
committed
Oct 9, 2023
1 parent
76ad692
commit b628a6c
Showing
13 changed files
with
680 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Overview | ||
|
||
## Types of Hosts | ||
|
||
1. Bare-Metal | ||
|
||
"Bare Metal" means that your host OS is running directly on a piece of hardware without any | ||
virtulization. This reduces the complexity of deploymnet at the cost of increased time and effort | ||
for re-provisioning the host. | ||
|
||
2. Virtual Machines | ||
|
||
Virtual Machines are a software-defined layer of abstraction atop a Bare-Metal host which makes | ||
deployments more consistent and easier to manage declaratively. This greaty reduces the difficulty | ||
of re-deployment and creates the conditions required for securely running multiple guests within the | ||
same physical host. Virtual Machines can also be used to create hosts that run different operating | ||
systems (Windows, MacOS) or architectures (ARM) than the host machine. This added functionality | ||
comes at the cost of added complexity, a slight performance penalty, and you need to already have a | ||
Bare-Metal host on which to run the VMs. |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,143 @@ | ||
--- | ||
toc_max_heading_level: 4 | ||
--- | ||
|
||
# Multipass | ||
|
||
:::info Multipass only creates Ubuntu VMs ::: | ||
|
||
Multipass is a light-weight Virtual Machine Manager for Linux, Windows and MacOS. It's designed for | ||
developers who want to quickly create a fresh Ubuntu environment with a single command. It uses the | ||
native hypervisor for whichever platform it is installed on (KVM on Linux, Hyper-V on Windows and | ||
HyperKit on MacOS) to run VMs with minimal overhead. It can also use VirtualBox on Windows and | ||
MacOS. | ||
|
||
- [Official Webite](https://multipass.run/) | ||
- [Official Github Repo](https://github.com/canonical/multipass) | ||
|
||
## installation | ||
|
||
To install multipass on Linux use the commands below. | ||
|
||
```bash | ||
sudo apt-get install snapd | ||
sudo snap install core | ||
sudo snap install multipass | ||
``` | ||
|
||
For installation on Windows and MacOS, refer to the official installation instructions: | ||
|
||
- [How to install Multipass on Windows](https://multipass.run/docs/installing-on-windows) | ||
- [How to install Multipass on macOS](https://multipass.run/docs/installing-on-macos) | ||
|
||
## Creating a VM | ||
|
||
1. Set values | ||
|
||
```bash | ||
# The name of the Virtual Machine | ||
export VM_NAME="gameci" | ||
|
||
# The name of the user to create | ||
export VM_USER="vmadmin" | ||
|
||
# Number of CPU cores to allocate to the VM | ||
export VM_CPUS="2" | ||
|
||
# Amount of Disk Space to allocate to the VM. | ||
# Cannot exceed available on host. | ||
export VM_DISK="32G" | ||
|
||
# Amount of RAM to allocate to the VM. | ||
# Cannot exceed available RAM on host. | ||
export VM_MEM="8G" | ||
|
||
# Set path on MacOS systems | ||
export PATH="$PATH:/usr/local/bin/multipass" | ||
|
||
# Set path on Linux system | ||
export PATH="$PATH:/usr/local/bin/multipass" | ||
``` | ||
|
||
2. Create an ssh-key for authenticating with the VM | ||
|
||
```bash | ||
ssh-keygen -C $VM_USER -f runner | ||
``` | ||
|
||
3. Add the public ssh-key to a cloud-init file | ||
|
||
See the [cloud init](https://cloudinit.readthedocs.io/en/latest/topics/examples.html) docs for more | ||
examples. | ||
|
||
```bash | ||
VM_KEY=$(cat runner.pub) | ||
|
||
cat << EOF > cloud-init.yaml | ||
#cloud-config | ||
groups: | ||
- docker | ||
users: | ||
- default | ||
- name: ${VM_USER} | ||
sudo: ALL=(ALL) NOPASSWD:ALL | ||
shell: /bin/bash | ||
groups: docker, admin, sudo, users | ||
no_ssh_fingerprints: true | ||
ssh-authorized-keys: | ||
- ${VM_KEY} | ||
packages: | ||
- docker.io | ||
runcmd: | ||
- [ sed , -i , "s/#PermitRootLogin prohibit-password/PermitRootLogin no/g" , /etc/ssh/sshd_config ] | ||
EOF | ||
``` | ||
|
||
4. Start the VM | ||
|
||
See the [multipass launch](https://multipass.run/docs/launch-command) command docs for more | ||
information. | ||
|
||
```bash | ||
export VERBOSITY="-vvvvvv" | ||
|
||
/snap/bin/multipass launch --name $VM_NAME \ | ||
--cpus $VM_CPUS \ | ||
--disk $VM_DISK \ | ||
--mem $VM_MEM \ | ||
--cloud-init cloud-init.yaml \ | ||
$VERBOSITY | ||
``` | ||
|
||
4. Get the VM's IP address | ||
|
||
```bash | ||
VM_IP=$(/snap/bin/multipass list |grep "${VM_NAME}" |awk '{print $3}') | ||
``` | ||
|
||
5. Connect to the VM via ssh or cli | ||
|
||
ssh: | ||
|
||
```bash | ||
ssh -i runner $VM_USER@$VM_IP -o StrictHostKeyChecking=no -vvvv | ||
``` | ||
|
||
CLI: | ||
|
||
```bash | ||
multipass shell $VM_NAME | ||
``` | ||
|
||
6. Install the runner application using one of the guides below: | ||
|
||
- [Github Actions](../04-runner-application-installation/02-github-actions.mdx) | ||
- [Gitlab Pipelines](../04-runner-application-installation/01-gitlab-pipelines.mdx) | ||
|
||
7. Cleanup when finished | ||
|
||
```bash | ||
/snap/bin/multipass stop $VM_NAME | ||
/snap/bin/multipass delete $VM_NAME | ||
/snap/bin/multipass purge | ||
``` |
142 changes: 0 additions & 142 deletions
142
docs/12-self-hosting/02-host-creation/02-virtual-machines-basic.mdx
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.