Libvirt: Difference between revisions
imported>Fadenb m xml syntax highlighting |
imported>Wackbyte fix some formatting and syntax highlighting |
||
| Line 14: | Line 14: | ||
If you would like to enable nested virtualization for your guests to run KVM hypervisors inside them, you should enable it as follows: {{nixos:option|boot.extraModprobeConfig}}, for example: | If you would like to enable nested virtualization for your guests to run KVM hypervisors inside them, you should enable it as follows: {{nixos:option|boot.extraModprobeConfig}}, for example: | ||
< | <syntaxhighlight lang="nix"> | ||
boot.extraModprobeConfig = "options kvm_intel nested=1"; | |||
</syntaxhighlight> | |||
== Tools == | == Tools == | ||
| Line 32: | Line 34: | ||
It is possible to work around those issues without modifying the package (when a pristine nixpkgs is needed). | It is possible to work around those issues without modifying the package (when a pristine nixpkgs is needed). | ||
<syntaxhighlight | <syntaxhighlight lang="shell-session"> | ||
$ mkdir -p ~/.config/virt-builder | $ mkdir -p ~/.config/virt-builder | ||
$ cd ~/.config/virt-builder | $ cd ~/.config/virt-builder | ||
| Line 57: | Line 59: | ||
<syntaxhighlight lang="xml"> | <syntaxhighlight lang="xml"> | ||
<graphics type='spice' port='5900' autoport='no' listen='0.0.0.0' keymap='de-ch' defaultMode='insecure'> | |||
<listen type='address' address='0.0.0.0'/> | |||
<image compression='auto_lz'/> | |||
</graphics> | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 68: | Line 70: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
services.networking.websockify = { | |||
enable = true; | |||
sslCert = "/https-cert.pem"; | |||
sslKey = "/https-key.pem"; | |||
portMap = { | |||
"5959" = 5900; | |||
}; | |||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||
| Line 96: | Line 98: | ||
<syntaxhighlight lang="nix"> | <syntaxhighlight lang="nix"> | ||
services.nginx = { | |||
enable = true; | |||
virtualHosts."mydomain.tld" = { | |||
forceSSL = true; | |||
root = "/var/www/"; | |||
locations."/spice/" = { | |||
index = "index.html index.htm"; | |||
}; | |||
locations."/websockify/" = { | |||
proxyWebsockets = true; | |||
proxyPass = "https://127.0.0.1:5959"; | |||
extraConfig = '' | |||
proxy_read_timeout 61s; | |||
proxy_buffering off; | |||
''; | |||
}; | }; | ||
sslCertificate = "/https-cert.pem"; | |||
sslCertificateKey = "/https-key.pem"; | |||
listen = [ { addr = "*"; port = 45000; ssl = true; } ]; | |||
}; | |||
}; | |||
</syntaxhighlight> | </syntaxhighlight> | ||