forked from andonome/lk
change formatting
input examples are now given as ```bash input $ARG1 ``` While outputs use md's '> ' sign as a quote.
This commit is contained in:
@@ -2,49 +2,71 @@
|
||||
title: "Docker"
|
||||
tags: [ "documentation", "Virtualization" ]
|
||||
---
|
||||
> sudo pacman -S docker
|
||||
```bash
|
||||
sudo pacman -S docker
|
||||
```
|
||||
|
||||
> sudo usermod -aG docker $USER
|
||||
```bash
|
||||
sudo usermod -aG docker $USER
|
||||
```
|
||||
|
||||
> sudo systemctl start docker
|
||||
```bash
|
||||
sudo systemctl start docker
|
||||
```
|
||||
|
||||
You need to either log out and back in again to be in the docker group, or run everything as root.
|
||||
|
||||
> # docker info
|
||||
```bash
|
||||
# docker info
|
||||
```
|
||||
|
||||
This should show you things are working.
|
||||
|
||||
Search for a distro you want
|
||||
|
||||
> docker search debian
|
||||
```bash
|
||||
docker search debian
|
||||
```
|
||||
|
||||
If you get a hit, pull it.
|
||||
|
||||
> docker pull debian
|
||||
```bash
|
||||
docker pull debian
|
||||
```
|
||||
|
||||
Then run a live image:
|
||||
|
||||
> docker run -it debian
|
||||
```bash
|
||||
docker run -it debian
|
||||
```
|
||||
|
||||
# Delete
|
||||
|
||||
Check currently running containers with
|
||||
|
||||
> docker ps
|
||||
```bash
|
||||
docker ps
|
||||
```
|
||||
|
||||
Check all containers with
|
||||
|
||||
> docker ps -a
|
||||
```bash
|
||||
docker ps -a
|
||||
```
|
||||
|
||||
Now we can get a list of all containers.
|
||||
|
||||
To delete one, take the id, e.g. '97796727e883', and run:
|
||||
|
||||
> docker rm 97796727e883
|
||||
```bash
|
||||
docker rm 97796727e883
|
||||
```
|
||||
|
||||
# Networking
|
||||
|
||||
Get a list of docker container ips
|
||||
|
||||
> docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' *container_name_or_id*
|
||||
```bash
|
||||
docker inspect -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' *container_name_or_id*
|
||||
```
|
||||
|
||||
|
@@ -6,33 +6,49 @@ tags: [ "Documentation", "System" ]
|
||||
|
||||
## Arch Linux
|
||||
|
||||
> sudo pacman -S virtualbox-host-modules-arch virtualbox-guest-iso
|
||||
```bash
|
||||
sudo pacman -S virtualbox-host-modules-arch virtualbox-guest-iso
|
||||
```
|
||||
|
||||
> sudo modprobe vboxdrv
|
||||
```bash
|
||||
sudo modprobe vboxdrv
|
||||
```
|
||||
|
||||
> # vboxreload
|
||||
```bash
|
||||
# vboxreload
|
||||
```
|
||||
|
||||
Make dd image into vdi
|
||||
|
||||
> VBoxManage convertdd base.dd output.vdi --format VDI
|
||||
```bash
|
||||
VBoxManage convertdd base.dd output.vdi --format VDI
|
||||
```
|
||||
|
||||
If this doesn't work, try to make a new bite size with just
|
||||
|
||||
> sudo dd if=image.dd of=image2.dd bs=512 conv=sync
|
||||
```bash
|
||||
sudo dd if=image.dd of=image2.dd bs=512 conv=sync
|
||||
```
|
||||
|
||||
## CLI Management
|
||||
|
||||
List boxes:
|
||||
|
||||
> VBoxManage list vms
|
||||
```bash
|
||||
VBoxManage list vms
|
||||
```
|
||||
|
||||
Start a headless instance
|
||||
|
||||
> VBoxManage startvm "rata" --type headless
|
||||
```bash
|
||||
VBoxManage startvm "rata" --type headless
|
||||
```
|
||||
|
||||
To pause the machine:
|
||||
|
||||
> VBoxManage controlvm "rata" pause --type headless
|
||||
```bash
|
||||
VBoxManage controlvm "rata" pause --type headless
|
||||
```
|
||||
|
||||
You can do a number of things to virtualboxes this way:
|
||||
|
||||
@@ -48,11 +64,17 @@ You can do a number of things to virtualboxes this way:
|
||||
|
||||
Creating a VM requires registering it:
|
||||
|
||||
> VBoxManage createvm --name Ubuntu19.04 --register --ostype Ubuntu
|
||||
```bash
|
||||
VBoxManage createvm --name Ubuntu19.04 --register --ostype Ubuntu
|
||||
```
|
||||
|
||||
> VBoxManage modifyvm Ubuntu19.04 --memory 1042
|
||||
```bash
|
||||
VBoxManage modifyvm Ubuntu19.04 --memory 1042
|
||||
```
|
||||
|
||||
> VBoxManage storagectl Ubuntu19.04 -name IDE --add ide --controller PIIX4 --bootable on
|
||||
```bash
|
||||
VBoxManage storagectl Ubuntu19.04 -name IDE --add ide --controller PIIX4 --bootable on
|
||||
```
|
||||
|
||||
Create just a disk with:
|
||||
|
||||
|
@@ -4,39 +4,59 @@ tags: [ "documentation", "virtualization", "xen" ]
|
||||
---
|
||||
# Basic VM Management
|
||||
|
||||
> xe vm-list
|
||||
```bash
|
||||
xe vm-list
|
||||
```
|
||||
|
||||
Start, stop, et c. all done with `xe`:
|
||||
|
||||
> xe vm-start vm=*TTS*
|
||||
```bash
|
||||
xe vm-start vm=*TTS*
|
||||
```
|
||||
|
||||
> xe vm-shutdown vm=*Bob*
|
||||
```bash
|
||||
xe vm-shutdown vm=*Bob*
|
||||
```
|
||||
|
||||
Destruction requires the uuid.
|
||||
|
||||
> xe vm-destroy uuid=*243b1165-14aa-37f6-496f-44879d05b3f2*
|
||||
```bash
|
||||
xe vm-destroy uuid=*243b1165-14aa-37f6-496f-44879d05b3f2*
|
||||
```
|
||||
|
||||
# Shut Down VM
|
||||
|
||||
List VMs.
|
||||
|
||||
> xe host-list
|
||||
```bash
|
||||
xe host-list
|
||||
```
|
||||
|
||||
> xe vm-list resident-on=*<uuid_of_host>*
|
||||
```bash
|
||||
xe vm-list resident-on=*<uuid_of_host>*
|
||||
```
|
||||
|
||||
> xe vm-shutdown uuid=*<UUID from step 3>* force=true
|
||||
```bash
|
||||
xe vm-shutdown uuid=*<UUID from step 3>* force=true
|
||||
```
|
||||
|
||||
If this doesn't work, try:
|
||||
|
||||
> xe vm-reset-powerstate uuid=*<UUID from step 3>* force=true
|
||||
```bash
|
||||
xe vm-reset-powerstate uuid=*<UUID from step 3>* force=true
|
||||
```
|
||||
|
||||
Get the id:
|
||||
|
||||
> list_domains
|
||||
```bash
|
||||
list_domains
|
||||
```
|
||||
|
||||
And destroy the domain:
|
||||
|
||||
> /opt/xensource/debug/xenops destroy_domain -domid *<DOMID from step 7>*
|
||||
```bash
|
||||
/opt/xensource/debug/xenops destroy_domain -domid *<DOMID from step 7>*
|
||||
```
|
||||
|
||||
# Error: `Internal error:xenopsd internal error: Storage_interface.Illegal_transition` in XenServer
|
||||
|
||||
@@ -52,7 +72,9 @@ To resolve this error, complete the following procedure:
|
||||
|
||||
Open the Console to the XenServer that is hosting the VM and run the following command:
|
||||
|
||||
> list_domains
|
||||
```bash
|
||||
list_domains
|
||||
```
|
||||
|
||||
All the VMs running on that server are displayed.
|
||||
|
||||
@@ -62,17 +84,25 @@ This is the UUID of the Control Domain. The Control Domain is a privileged Virtu
|
||||
|
||||
Run the following command to obtain the UUID of the VBD (Virtual Block Device) object linking the Control Domain:
|
||||
|
||||
> xe vbd-list vm-uuid=*<uuid of the Control Domain>*
|
||||
```bash
|
||||
xe vbd-list vm-uuid=*<uuid of the Control Domain>*
|
||||
```
|
||||
|
||||
Run the following commands to unplug and destroy the VBD:
|
||||
|
||||
> xe vbd-unplug uuid=*<uuid of the vbd>*
|
||||
```bash
|
||||
xe vbd-unplug uuid=*<uuid of the vbd>*
|
||||
```
|
||||
|
||||
> xe vbd-destroy uuid=*<uuid of the vbd>*
|
||||
```bash
|
||||
xe vbd-destroy uuid=*<uuid of the vbd>*
|
||||
```
|
||||
|
||||
## Make a local iso repository
|
||||
|
||||
> xe sr-create name-label=LocalISO type=iso device-config:location=/var/opt/xen/ISO_Store device-config:legacy_mode=true content-type=iso
|
||||
```bash
|
||||
xe sr-create name-label=LocalISO type=iso device-config:location=/var/opt/xen/ISO_Store device-config:legacy_mode=true content-type=iso
|
||||
```
|
||||
|
||||
This creates a UUID for the new directory:
|
||||
|
||||
@@ -90,15 +120,21 @@ Put in the USB.
|
||||
|
||||
Get the USB's uuid.
|
||||
|
||||
> xe pusb-list
|
||||
```bash
|
||||
xe pusb-list
|
||||
```
|
||||
|
||||
Make the USB recognised as a device.
|
||||
|
||||
> xe pusb-param-set uuid=*<uuid>*
|
||||
```bash
|
||||
xe pusb-param-set uuid=*<uuid>*
|
||||
```
|
||||
|
||||
For passthrough, use this:
|
||||
|
||||
> xe pusb-param-set uuid=*<uuid>* passthrough-enabled=true
|
||||
```bash
|
||||
xe pusb-param-set uuid=*<uuid>* passthrough-enabled=true
|
||||
```
|
||||
|
||||
## Attach to host
|
||||
|
||||
@@ -108,12 +144,18 @@ For passthrough, use this:
|
||||
|
||||
# Storage Spaces - "SR"
|
||||
|
||||
> xe sr-list
|
||||
```bash
|
||||
xe sr-list
|
||||
```
|
||||
|
||||
# Exporting and Exporting VMs
|
||||
|
||||
> xe vm-export vm=*<Name>* filename=*/full/path.xva*
|
||||
```bash
|
||||
xe vm-export vm=*<Name>* filename=*/full/path.xva*
|
||||
```
|
||||
|
||||
> xe vm-import vm=*<Name>* filename=*/full/path.xva*
|
||||
```bash
|
||||
xe vm-import vm=*<Name>* filename=*/full/path.xva*
|
||||
```
|
||||
|
||||
|
||||
|
@@ -4,9 +4,13 @@ tags: [ "Documentation", "xe", "virtualization", "volume" ]
|
||||
---
|
||||
# Make a local iso repository
|
||||
|
||||
> mkdir -p */var/opt/xen/ISO_Store*
|
||||
```bash
|
||||
mkdir -p */var/opt/xen/ISO_Store*
|
||||
```
|
||||
|
||||
> xe sr-create name-label=*LocalISO* type=iso device-config:location=*/var/opt/xen/ISO_Store* device-config:legacy_mode=true content-type=iso
|
||||
```bash
|
||||
xe sr-create name-label=*LocalISO* type=iso device-config:location=*/var/opt/xen/ISO_Store* device-config:legacy_mode=true content-type=iso
|
||||
```
|
||||
|
||||
This creates a UUID for the new directory:
|
||||
|
||||
@@ -14,15 +18,21 @@ This creates a UUID for the new directory:
|
||||
|
||||
# Main Console
|
||||
|
||||
> xsconsole
|
||||
```bash
|
||||
xsconsole
|
||||
```
|
||||
|
||||
# Volumes
|
||||
|
||||
List volumes:
|
||||
|
||||
> lvs
|
||||
```bash
|
||||
lvs
|
||||
```
|
||||
|
||||
List groups:
|
||||
|
||||
> vgs
|
||||
```bash
|
||||
vgs
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user