32 lines
No EOL
877 B
Markdown
32 lines
No EOL
877 B
Markdown
* Nix-shell for managing
|
|
|
|
nix-shell -p virt-viewer libvirt virtinst libguestfs
|
|
|
|
* IPtables setup
|
|
|
|
```sh
|
|
iptables -A INPUT -p tcp --dport ssh -j ACCEPT
|
|
iptables -A INPUT -p tcp --dport http -j ACCEPT
|
|
iptables -A INPUT -p tcp --dport https -j ACCEPT
|
|
iptables -A INPUT -i lo -j ACCEPT
|
|
iptables -A OUTPUT -o lo -j ACCEPT
|
|
iptables -A INPUT -m conntrack --ctstate ESTABLISHED,RELATED -j ACCEPT
|
|
iptables -A INPUT -j DROP
|
|
```
|
|
|
|
* Save and restore iptables config
|
|
|
|
```sh
|
|
iptables-save > /etc/iptables.rules
|
|
iptables-restore /etc/iptables.rules
|
|
```
|
|
|
|
```
|
|
apt install nginx
|
|
|
|
apt install qemu-kvm libvirt-bin virtinst
|
|
|
|
sudo virt-install -n ubuxx64 -r 1024 --disk path=/var/lib/libvirt/images/ubuxx64.img,bus=virtio,size=16 -c /home/jakob/Downloads/ubuntu-16.04.1-server-amd64.iso --network network=default,model=virtio --graphics vnc,listen=0.0.0.0 --noautoconsole -v
|
|
|
|
apt install virsh
|
|
``` |