lxc is Linux Container, allow you to run light weight virtual servers on your computer.
It is better use LXD instead of LXC as LXD provide much easier to use interface to LXC.
Create lxc container with lxc-create
To install lxc, run
1 |
apt install -y lxc |
To create a VM, use
1 |
lxc-create -t download -n first-vm |
To list VM, use command lxc-ls
1 2 3 4 5 6 |
root@UNUSED:~# lxc-ls first-vm root@UNUSED:~# lxc-ls -f NAME STATE AUTOSTART GROUPS IPV4 IPV6 UNPRIVILEGED first-vm RUNNING 0 - 10.0.3.26 - false root@UNUSED:~# |
To start a VM, run
1 |
lxc-start VM_NAME |
To login to a VM, run
1 |
lxc-attach VM_NAME |