---
title: "KVM vs LXC: difference between a full VM and a container | StreetHosting"
description: "KVM runs a separate kernel per VPS; LXC shares the host kernel. Compare isolation, Docker, WireGuard, modules, swap and performance, and identify yours."
url: "https://streethosting.com.br/en/guides/vps/kvm-vs-lxc"
type: "page"
language: "en-US"
---

VPS · 10 min · Intermediate

Published on Sep 28, 2026 · Updated on Sep 28, 2026

# KVM vs LXC in practice: virtual machine or system container

KVM gives you an entire virtual computer with its own kernel. LXC gives you an isolated space inside the host's operating system. See what that changes for Docker, VPN, swap and security, and how to find out which of the two your VPS runs on.

By [Equipe StreetHosting](https://streethosting.com.br/en/autores#equipe-streethosting) · StreetHosting infrastructure and support team

[Containers and Docker](https://streethosting.com.br/en/guides/topics/docker) [Hardware and datacenter](https://streethosting.com.br/en/guides/topics/hardware)

Summarize with:

[](https://chat.openai.com/?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fkvm-vs-lxc.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "ChatGPT") [](https://claude.ai/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fkvm-vs-lxc.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Claude") [](https://www.google.com/search?udm=50&aep=11&q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fkvm-vs-lxc.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Google AI Mode") [](https://x.com/i/grok?text=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fkvm-vs-lxc.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Grok") [](https://www.perplexity.ai/search/new?q=Summarize%20the%20key%20points%20of%20this%20StreetHosting%20guide%3A%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fkvm-vs-lxc.%20Highlight%20the%20step-by-step%20instructions%2C%20the%20prerequisites%20and%20the%20most%20common%20mistakes. "Perplexity")

Share:

[](https://x.com/intent/tweet?text=KVM%20vs%20LXC%3A%20difference%20between%20a%20full%20VM%20and%20a%20container&url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fkvm-vs-lxc "Share on X") [](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fkvm-vs-lxc "Share on Facebook") [](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fkvm-vs-lxc "Share on LinkedIn") [](https://wa.me/?text=KVM%20vs%20LXC%3A%20difference%20between%20a%20full%20VM%20and%20a%20container%20https%3A%2F%2Fstreethosting.com.br%2Fen%2Fguides%2Fvps%2Fkvm-vs-lxc "Share on WhatsApp")

For agents: Copy as Markdown [.md](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc.md)

In this guide 7 sections

* [Two ways to split a server](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#duas-formas)
* [KVM and LXC side by side](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#lado-a-lado)
* [Docker, WireGuard, modules and swap](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#compatibilidade)
* [Performance, isolation and security](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#desempenho-isolamento)
* [How to tell if your VPS is KVM or LXC](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#como-identificar)
* [When to use each one](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#quando-cada-um)
* [KVM VPS at StreetHosting](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#vps-kvm)

Quick answer

The difference between **KVM vs LXC**comes down to the kernel. With KVM, each VPS is a complete virtual machine with its own kernel, which accepts Docker, WireGuard, modules, swap and even Windows without depending on the host. With LXC, each VPS is a container that shares the host's kernel: it uses fewer resources, but it only runs Linux and only does what the host allows. To find out which one you have, run `systemd-detect-virt`.

## Two ways to split a server[](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#duas-formas)

Every VPS provider takes a large physical server and splits it among several customers. The question is at which layer that split happens.

**KVM**splits at the hardware level. It is a Linux kernel module that uses the virtualization extensions Intel and AMD build into their processors to run complete virtual machines. Each VM has a virtual BIOS or UEFI, a virtual disk, a virtual network card and its own kernel, which boots just like on a real computer. The VM's operating system does not know, and does not need to know, what runs on the host.

**LXC**splits at the operating system level. There is no virtual machine: the host has a single kernel, and each container is a set of processes isolated by namespaces, which separate the view of processes, network, users and filesystem, and limited by cgroups, which control how much CPU and memory it can use. The container has its own systemd, its own users and its own packages, but everything is executed by the host's kernel.

It is worth separating LXC from Docker, which is also a container. Docker was designed to package an application, with one main process per container. LXC is a system container, which runs an entire Linux distribution and behaves like a lightweight VPS. Tools such as LXD, Incus and Proxmox use LXC underneath, and the older OpenVZ follows the same idea of sharing the kernel. The guide on [KVM VPS and its advantages](https://streethosting.com.br/en/guides/vps/what-is-a-kvm-vps) goes deeper into the full virtualization side.

## KVM and LXC side by side[](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#lado-a-lado)

| Aspect              | KVM (virtual machine)               | LXC (system container)                       |
| ------------------- | ----------------------------------- | -------------------------------------------- |
| Kernel              | Your own, chosen and updated by you | The host's, with no choice of version        |
| Supported systems   | Linux, Windows, BSD and others      | Linux only                                   |
| Kernel modules      | You load whatever you need          | Only the ones the host loaded                |
| Docker              | Installs and runs with no tweaks    | Depends on the host enabling nesting         |
| WireGuard           | Native module in the VM's kernel    | Needs the module on the host plus permission |
| Swap                | You create and size it              | Set by the host, no swapon                   |
| Isolation           | Strong, separate kernels            | Good, but the kernel is shared               |
| Overhead            | Small, with virtio drivers          | Almost none                                  |
| Density on the host | Lower                               | Higher, more instances per machine           |
| Memory              | The VM sees RAM as its own hardware | cgroup limit over the host's memory          |

The table shows the pattern: everything that involves the kernel is free on KVM and conditional on LXC. In exchange, LXC is lighter, starts in seconds and lets you pack more instances onto the same hardware. That density is a real advantage for anyone running their own server and an attraction for providers who want to sell very cheap plans.

## Docker, WireGuard, modules and swap in practice[](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#compatibilidade)

This is where the difference stops being theory. Four common VPS situations show where the system container tends to get stuck.

### Docker[](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#docker)

Running Docker inside LXC means putting one container inside another. The host has to enable nesting and some system calls, and Docker's storage driver has to work on top of the container's filesystem. When the provider has not set that up, you get permission errors when pulling images or networks that never come up. On KVM, the process is the same as on a physical server, as shown in the guide on [installing Docker on Ubuntu](https://streethosting.com.br/en/guides/vps/install-docker-ubuntu-vps).

### WireGuard and VPN[](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#wireguard)

WireGuard has lived inside the Linux kernel since version 5.6. On a KVM VM with Ubuntu 22.04 or 24.04, the kernel already ships the module, and installation comes down to the tools package:

`sudo apt update && sudo apt install -y wireguard sudo modprobe wireguard && lsmod | grep wireguard`

On LXC, the `modprobe` fails, because the container cannot load modules into the host's kernel. WireGuard only works if the host already has the module loaded and the container has permission to create the interface. Without that, you are left with the userspace implementation, such as `wireguard-go`, which works with lower performance. The full setup is in [WireGuard VPN on your VPS](https://streethosting.com.br/en/guides/vps/wireguard-vpn-vps).

### Kernel modules and parameters[](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#modulos)

Anything that needs its own module follows the same rule: special filesystems, some firewall features, network congestion control algorithms and eBPF-based observability tools. Network parameters can often be tuned inside the container, because the network has its own namespace. Memory parameters, such as `vm.swappiness`, are global to the kernel and generally cannot be changed on LXC.

### Swap and kernel version[](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#swap)

On KVM you create a swap file whenever you want, following the guide on [setting up swap on Ubuntu](https://streethosting.com.br/en/guides/vps/set-up-swap-ubuntu-vps). On LXC the `swapon` command is denied, and the available swap is whatever the host decided. The same goes for the kernel: inside the container, `uname -r` shows the host's version, and updating the kernel package through apt changes nothing, because that is not the kernel that is running.

Need Windows? Only full virtualization runs another operating system, because LXC depends on the host's Linux kernel. At StreetHosting, Windows runs on KVM and has a page of its own: [Windows VPS](https://streethosting.com.br/en/vps-windows).

## Performance, isolation and security[](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#desempenho-isolamento)

In CPU performance, the difference between the two is smaller than its reputation suggests. KVM executes the VM's instructions directly on the processor, with help from the virtualization extensions, and uses virtio drivers for disk and network, which avoid emulating legacy hardware. What remains is a small overhead, more noticeable in I/O than in computation. LXC has almost no overhead, because the container's processes are ordinary host processes.

The bigger difference is in memory. Each KVM VM carries its own kernel and its own disk cache, which consumes RAM that would be shared under LXC. That is why more containers than VMs fit on the same server. For the customer, this has a side effect: in a container, tools such as `free` sometimes show host numbers or limits that are hard to interpret, and it becomes easier to sell memory that is not actually reserved. The guide on [VPS overselling](https://streethosting.com.br/en/guides/vps/what-is-vps-overselling) shows how to spot it in both models, because KVM can also be sold beyond capacity.

In security, KVM has a structural advantage. For a process to escape a VM and reach the host, it has to exploit a flaw in the hypervisor, a small and heavily audited surface. On LXC, every container talks to the same kernel, and a flaw in it can affect all of them at once. Unprivileged containers, where the container's root is an ordinary user on the host, reduce that risk considerably, but do not eliminate it.

On LXC, a neighbor that triggers a problem in the shared kernel, such as a hang or the exhaustion of some global resource, can take down the entire host. On KVM, a guest kernel failure stays confined to its own VM.

## How to tell if your VPS is KVM or LXC[](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#como-identificar)

Not every provider states the technology on the sales page. From inside the VPS, four commands answer in seconds:

`systemd-detect-virt hostnamectl | grep -i virtualization lscpu | grep -i -E 'hypervisor|virtualization type' uname -r`

| Command output | What it means                                   |
| -------------- | ----------------------------------------------- |
| kvm            | KVM virtual machine, with its own kernel        |
| lxc            | LXC container, host kernel                      |
| openvz         | OpenVZ container, host kernel                   |
| qemu           | Emulation without KVM acceleration, much slower |
| none           | No virtualization detected, physical server     |

On a KVM VM, hostnamectl shows kvm on the Virtualization line and lscpu reports KVM as the hypervisor vendor, with virtualization type full. In a container, uname usually reveals the host's kernel, sometimes with the virtualization system's own suffix, such as Proxmox's pve. Any answer other than kvm on a plan sold as KVM deserves a question to support.

## When LXC makes sense and when to choose KVM[](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#quando-cada-um)

LXC is not a bad technology. It is excellent when you are the one administering the host, because then the kernel limitations become your decision and the memory savings stay entirely on your side.

* **LXC makes sense** on a dedicated server with Proxmox or Incus running several isolated Linux services, in development and test environments that need to come up and go down quickly, and for separating small applications without paying the memory cost of a VM for each one.
* **KVM is the choice** when you rent a VPS from a provider and want autonomy: Docker without asking for anything, WireGuard VPN, swap, a kernel updated whenever you want, security tools that depend on modules, Windows, and strong isolation from your neighbors.

The rule of thumb: if the host is yours, both work and LXC saves money. If the host belongs to another company, KVM keeps you from discovering midway through a project that something essential is not allowed.

## KVM VPS at StreetHosting[](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#vps-kvm)

Every [StreetHosting VPS](https://streethosting.com.br/en/vps) uses KVM virtualization, with its own kernel and root access. Docker, WireGuard, swap and modules work just like on a physical server, with no ticket needed to get a feature enabled. The datacenter is in São Paulo, with NVMe, a 1 Gbps uplink, Anti-DDoS included and activation within 60 seconds.

* **Ryzen 9 9950X VPS:** DDR5 and boost up to 5.7 GHz, from R$ 40.00 with 1 vCPU and 2 GB to R$ 846.00 with 14 vCPU and 64 GB. An environment with Docker Compose, a database and a reverse proxy fits comfortably in 4 vCPU and 8 GB for R$ 118.00.
* **Xeon VPS:** DDR4 and more vCPU for your money, from R$ 26.00 with 2 vCPU and 2 GB to R$ 553.00 with 24 vCPU and 64 GB. A WireGuard VPN for your team runs comfortably on the entry plan.

Memory, vCPU and disk upgrades are done through the control panel, charging only the prorated difference for the billing cycle, with one VM reboot to apply. After ordering, run `systemd-detect-virt` and check: the answer will be kvm.

In this guide

* [Two ways to split a server](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#duas-formas)
* [KVM and LXC side by side](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#lado-a-lado)
* [Docker, WireGuard, modules and swap](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#compatibilidade)
* [Performance, isolation and security](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#desempenho-isolamento)
* [How to tell if your VPS is KVM or LXC](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#como-identificar)
* [When to use each one](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#quando-cada-um)
* [KVM VPS at StreetHosting](https://streethosting.com.br/en/guides/vps/kvm-vs-lxc#vps-kvm)

## Frequently asked questions

What is the difference between KVM and LXC?

KVM is full virtualization: each VPS is a virtual machine with its own kernel, which can be Linux, Windows or BSD. LXC is operating-system-level virtualization: each container is an isolated space that uses the host's kernel. KVM isolates more and accepts any kernel configuration; LXC uses fewer resources but depends on what the host allows.

Does Docker work on an LXC VPS?

It can, but it depends on the provider. The host has to enable container nesting and a few extra permissions, and even then some Docker networking and storage features can fail. On a KVM VPS, Docker installs and runs just like on a physical server, without asking the provider for anything.

How do I know if my VPS is KVM?

Run systemd-detect-virt in the terminal. The answer kvm means a KVM virtual machine; lxc means an LXC container; openvz means an OpenVZ container. The hostnamectl command shows the same information on the Virtualization line, and lscpu lists KVM as the hypervisor vendor.

Is LXC faster than KVM?

In raw processing the difference is small, because KVM uses the processor's virtualization extensions and virtio drivers for disk and network. LXC has almost zero overhead and uses less memory per instance, which allows more containers on the same host. In practice, what decides a VPS's performance is how contended the host is, not the technology.

Can I use WireGuard in an LXC container?

Only if the host has the WireGuard module loaded and the container has permission to create the network interface. Without that, you are left with the userspace implementation, which works with lower performance. On a KVM VPS, you just install the wireguard package, because the VM's own kernel already ships the module.

Next step

See VPS plans

Root VPS in Brazil with NVMe and Anti-DDoS.

[See VPS plans](https://streethosting.com.br/en/vps)

[See Ryzen VPS Ryzen 9 9950X VPS in São Paulo with root access, NVMe and gamer Anti-DDoS.](https://streethosting.com.br/en/vps/ryzen) [See Xeon VPS Xeon VPS for steady workloads, automation and long-running projects.](https://streethosting.com.br/en/vps/xeon)

## Related guides

[VPS Beginner What is a KVM VPS? Benefits for projects in Brazil Not every VPS delivers what it promises. KVM full virtualization gives you your own kernel, honest resources and the flexibility to run Docker, game servers and APIs in Brazil. 4 min Read guide](https://streethosting.com.br/en/guides/vps/what-is-a-kvm-vps) [VPS Intermediate VPS overselling: what it is and how to spot it Every VPS provider splits hardware between customers, and that is fine as long as you never feel the split. Here is how overselling happens in CPU, memory, disk and network, which signs show up inside your VPS, and how to test without jumping to conclusions. 10 min Read guide](https://streethosting.com.br/en/guides/vps/what-is-vps-overselling) [VPS Intermediate How to install Docker on Ubuntu 22.04 or 24.04 on a VPS (straight to the point) A stable Docker install on an Ubuntu VPS depends on the right package source and step by step validation. In this guide you set up the official repository, install Engine and Compose, test the daemon and apply basic security measures before deploying applications. 3 min Read guide](https://streethosting.com.br/en/guides/vps/install-docker-ubuntu-vps)

[← Back to the Guide Center](https://streethosting.com.br/en/guides)
