mirror-env/libvirt/README.md

84 lines
1.7 KiB
Markdown
Raw Normal View History

2021-09-28 00:02:19 -04:00
## Installation
2021-10-01 01:15:17 -04:00
### Prerequisites (debian)
Install QEMU and KVM
```
$ apt install --no-install-recommends qemu-system libvirt-clients libvirt-daemon-system
```
Install other packages for the playbook
```
$ apt install ansible cloud-image-utils dnsmasq ovmf python3
```
Packages I can't tell if you need or not
```
virtinst
virt-manager
bridge-utils
```
Then install virt-viewer to interact run through the install with
```
virt-viewer
```
### Prerequisites (archlinux)
**needs update**
```
$ pacman -S qemu libvirt virt-install virt-viewer ansible
```
### Running the Playbook
Run the playbook from one directory down
2021-09-27 22:49:49 -04:00
```
2021-09-28 00:02:19 -04:00
ansible-playbook libvirt/main.yml
2021-09-27 22:49:49 -04:00
```
2021-09-28 00:02:19 -04:00
Then connect to the created vm using virt-viewer
```
virt-viewer --domain-name mirror
```
If vm is on a remote machine
```
virt-viewer --connect qemu+ssh://user@X.X.X.X/system mirror
```
2021-10-01 01:15:17 -04:00
### Troubleshooting
2021-09-27 22:49:49 -04:00
```
net.ipv4.ip_forward = 1
2021-09-27 22:49:49 -04:00
```
```
modprobe kvm_intel
```
If running in `/root` may need to edit config
```
# edit /etc/libvirt/qemu.conf
user = "root"
group = "root"
$ service restart libvirtd
```
2021-10-01 01:15:17 -04:00
### Installing Ubuntu
user: local
password: password
TODO: add the rest of the images
<img src="ubuntu/01-networking.png" width="200" height="150">
can just press enter for can't remove cdrom
container may stop so will need to start with
```
virsh start mirror
```
after starting check the ip address of the vm with
```
virsh net-dhcp-leases mirbr0
```
and ssh
```
ssh local@192.168.123.XXX
```
in the machine switch to root and update before installing some packages and cloning the repo
```
$ sudo su
$ cd
$ apt update && apt upgrade
$ apt install git ansible
$ git clone https://git.csclub.uwaterloo.ca/public/mirror-env.git
```
then enter `mirror-env/mirror` and use the instructions listed there