# Running the operating system that you're currently using in a virtual machine (with Secure Boot and TPM emulation)

DevFeed: [Running the operating system that you're currently using in a virtual machine (with Secure Boot and TPM emulation)](<https://devfeed.tech/articles/running-the-operating-system-that-you-re-currently-using-in-a-virtual-machine-with-secure-boot-and-tpm-emulation-27118.md>)

Original publisher: [Read original article](<https://andrea.corbellini.name/2023/11/19/running-current-os-inside-vm/>)

Author: andreacorbellini

Published: 2023-11-19T16:33:00Z

Content type: tutorial

Language: en

Sources: [Andrea Corbellini](<https://devfeed.tech/sources/andrea-corbellini.md>)

Topics: [Ubuntu](<https://devfeed.tech/topics/ubuntu.md>), [Secure Boot](<https://devfeed.tech/topics/secure-boot.md>), [qemu](<https://devfeed.tech/topics/qemu.md>), [Operating system](<https://devfeed.tech/topics/operating-system.md>), [boot](<https://devfeed.tech/topics/boot.md>), [Kernel](<https://devfeed.tech/topics/kernel.md>)

Tags: [bootloader](<https://devfeed.tech/tags/bootloader.md>), [information-technology](<https://devfeed.tech/tags/information-technology.md>), [operating-systems](<https://devfeed.tech/tags/operating-systems.md>), [qemu](<https://devfeed.tech/tags/qemu.md>), [secure-boot](<https://devfeed.tech/tags/secure-boot.md>), [systems](<https://devfeed.tech/tags/systems.md>), [ubuntu](<https://devfeed.tech/tags/ubuntu.md>), [virtual](<https://devfeed.tech/tags/virtual.md>)

## AI overview

A tutorial explains how to run the operating system currently in use inside a virtual machine, preserving its settings and files. The procedure targets Ubuntu and uses a copy of the drive, TPM emulation with swtpm, and QEMU; it is intended for testing Secure Boot and predicting TPM state without rebooting.

## Source excerpt

In this article I will show you how to start your current operating system inside a virtual machine. That is: launching the operating system (with all your settings, files, and everything), inside a virtual machine, while you're using it. This article was written for Ubuntu, but it can be easily adapted to other distributions, and with appropriate care it can be adapted to ...