No administrator privileges required using QEmu Portable Linux links and notes


Links and notes for using Qemu and using Linux portablely from Windows with *** no administrator privileges ***.

By the way, Portable Virtualbox requires administrator privileges.


Hardware acceleration such as WHPX and HAXM cannot be used at all because administrator privileges are required. Therefore, the GUI environment is almost useless. Even though the CUI environment works, it's pretty light. Especially booting is slow.

Is it a little better with a portable X server for Windows? (unconfirmed) [Set up an X server on Windows]( A4% F2% CE% A9% A4% C6% A4% EB) MobaXterm (portable version available) Portable X-Server (Portable version of VcXsrv?)

I don't have a self-owned PC with administrator privileges or money, but I can only use it if I really want to use *** real *** Linux ... If you have money, it's overwhelmingly comfortable to consider VPS, and if it doesn't have to be real, Cygwin.

Install Qemu and Linux

I made a portable development environment that can be carried around with USB

Ubuntu, which explains in detail from the installation of Qemu to the installation of Debian and how to use it after that, works fine (with server configuration without X and minimum configuration).

If it is a Debian system, it takes a long time to install Linux on a USB memory without administrator privileges, so if possible, it is safe to install it on a local PC and copy the HDD image and Qemu to the USB memory after installation.

Personally, I recommend Alpine Linux, and probably because it is designed to reduce the disk size and resources used, the installation will be completed immediately even on a USB memory. Since it is used as a base for reducing the weight of Docker containers, there are some materials on the Web (it is worth knowing if you use Docker). It takes a long time to boot on QEmu (about 1 to 2 minutes in my environment), but it is faster than Debian (feeling). However, there is software that does not work well because it does not use glibc.

Qemu currently only offers the Windows version of binaries in installer format, but installation using the installer requires administrator privileges. (Once installed, all you have to do is copy the files ...)

To extract Qemu without any administrator privileges, unzip the Qemu installer with Universal Extractor 2. A warning message appears every time I start it, but Qemu itself works.

SSH connection with Qemu

Linux can be used on the screen of Qemu, but it is quite inconvenient such as not being able to copy and paste, so make it possible to connect with SSH. Being able to do this means that Linux on Qemu can be used as a local server (public servers are blocked by firewalls unless configured with administrator privileges).

NAT with QEMU How to SSH from host to guest using QEMU?

If you add -net user, hostfwd = tcp :: 2222-: 22 to the Qemu startup options, it seems that Qemu will relay the connection to port 2222 of the host to the connection to port 22 of the guest.

There is a description that uses the -redir option, but this option has been completely removed in recent versions and cannot be used.

qemu-system-x86_64 -m 1024 -net nic -net user,hostfwd=tcp::2222-:22 -hda hdd1.qcow2

For example, if you start qemu as above and start the SSH server on the Linux side on port 22 (default)

ssh -p 2222 Username@localhost

You can SSH to Linux on Qemu with. (If you use this command as it is, files and folders will be created on the local disk without permission, so be careful, the workaround will be described later)

How to enable multiple other ports, such as when you want to use a server other than SSH

-net user,hostfwd=tcp::3389-:3389,hostfwd=tcp::443-:443,hostfwd=tcp::992-:992

It seems that you should connect them in a string like this.

QEMU multiple port forwarding

Recent Windows 10 has an SSH client as standard, but if you use it as it is, it will ignore the environment variables and write the .ssh \ known_hosts file to the user folder on the local disk, so it will not be portable, and specify the location of the configuration file If you do not, the .ssh folder will be created without permission, so you need to specify / dev / null for each and set options so that files and folders are not created without permission.

ssh -F /dev/null -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -p 2222 Username@localhost

It seems that the above does not create files or folders in the user folder without permission. (You will not be asked yes / no again)

Carry a docker container

I installed docker on Linux (ubuntu) on Qemu and tried running the hello-world container, and it worked, so I'd like to try various things.

Install Docker on Ubuntu 18.04 LTS

Recommended Posts

No administrator privileges required using QEmu Portable Linux links and notes
Notes on using post-receive and post-merge
[Linux] Install Python 3 without administrator privileges