[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Virtual Machines: Newbie / novice questions



Hi,

rhkramer@gmail.com wrote:
>  * Is it right to consider that there is somehow a base OS

Normally there is a single real computer with its OS that runs virtual
computers as "guests".
(The Cloud might have its own habits to host VMs.)


> I'm guessing that the machine boots first into the hypervisor and then from
> there boot into any of one or more VMS, one of which would contain what I
> consider my main or base OS?

I use my real machine with its Debian 8 as my home system and have several
VMs for various development purposes. I operate them via SSH from terminal
windows of the host system.

The VMs are normal processes on the host OS which may have a host graphics
window to show their own graphics screen and to get user input. They may
have access to some hardware components of the host system (e.g. a DVD drive).
Most important is their connection to the host system and the internet
via a virtual network card.


> * I know (or I'm 99.9% sure) that the software for a VM is on separate 
> partitions

It is typically on virtual disks which on the host system are data files
or disk partitions. Sharing of files may e.g. be done via services over
the virtual network.


>    * Can I keep a VM in a running state for instant switching to it?

Yes. As long as your real machine has enough memory to serve all processes
of the host OS and as long as you don't need a piece of hardware which
the VM uses exclusively.


> I presume that in that case, it will be using RAM, on the other hand,
> it could be in a non-running (either non-booted or suspended-to-disk)
> and not be using RAM?

If the real RAM of the host system does not suffice, then swapping will
begin. If the swap space is exhausted, processes will die.


>    * I presume that booting a VM takes  about the same amount of time, maybe
> a little longer than booting the base machine

If the VM has the same CPU type as the host system and can use kvm, then
it is not supposed to compute much slower than on real hardware. Access to
virtual disks might be slow compared to the disk speed on the host system.


>    * Can I C&P between (applicatons in) different VMs and/or the base OS?

Afaik, the graphics windows of VM do not show text but rather mindless
pixels. So no copy+paste.
But you may use the display of your host system as X terminal which starts
applications on the VMs. (As said, the virtual network is essential in most
use cases.)

-------------------------------------------------------------------------

Try it.

For example, on a modern 64 bit machine with 8 GiB of RAM, get one of the
ISOs at
  https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/
(let's say: debian-live-8.8.0-amd64-xfce-desktop.iso )
and start qemu+kvm with 4 GiB of RAM by

  qemu-system-x86_64 -enable-kvm -m 4096 -cdrom debian-live-8.8.0-amd64-xfce-desktop.iso  

A graphics window should pop up and show you the boot menu.

If you create a file for a virtual disk by command qemu-img

  qemu-img create vm_64gb_disk.qemu 64G

you may attach it to the starting VM by

  qemu-system-x86_64 ... \
                     -hda vm_64gb_disk.qemu

For my VMs which shall be operated without graphics screen, i let qemu
forward a host port (here 4567) to port 22 of the guest, where a SSH
server will be set up by installation to offer login:

  qemu-system-x86_64 ... \
                     -net nic -net user,hostfwd=tcp::4567-:22 

When the system is installed, i add option -nographic and access the
then headless system by

  ssh -p 4567 my_user@localhost

The option -cdrom and the ISO image are then not used any more.


There are VM control tools by which one can create and manage VMs.
But i have no experience with them.


Have a nice day :)

Thomas


Reply to: