Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

How to generate a KVM VM witout the installation step?

Linux Kernel, Network, and Services configuration.
Post Reply
Message
Author
User avatar
fender0107401
Posts: 52
Joined: 2014-05-10 11:42

How to generate a KVM VM witout the installation step?

#1 Post by fender0107401 »

I know I can generate an KVM VM with the virsh-install command, but virsh-install always runs the installation program.

I hope there is a way to generate an KVM VM (set memory size, cpu core number, network and disk image) without running the installation program.

Is that possible?

CwF
Global Moderator
Global Moderator
Posts: 2638
Joined: 2018-06-20 15:16
Location: Colorado
Has thanked: 41 times
Been thanked: 192 times

Re: How to generate a KVM VM witout the installation step?

#2 Post by CwF »

What's the question? Does installation refer to the guest OS? If you create the machine with a previous working image as it's storage, it fires up that image. No storage, just a post screen and no OS message. Live iso, boots it...etc.

User avatar
fender0107401
Posts: 52
Joined: 2014-05-10 11:42

Re: How to generate a KVM VM witout the installation step?

#3 Post by fender0107401 »

CwF wrote:What's the question? Does installation refer to the guest OS? If you create the machine with a previous working image as it's storage, it fires up that image. No storage, just a post screen and no OS message. Live iso, boots it...etc.
Yes, the installation refers the guest OS installation.

In fact I am looking an way to write a Perl script to generate many VMs, so I hope I can generate an VM and without starting it (the generation command can immediately run and return).

pcalvert
Posts: 1939
Joined: 2006-04-21 11:19
Location: Sol Sector
Has thanked: 1 time
Been thanked: 2 times

Re: How to generate a KVM VM witout the installation step?

#4 Post by pcalvert »

I never use the virsh-install command. It's not necessary. In fact, that command is not even available on my system.

Here are some examples from my notes:

Code: Select all

# Install Windows XP
$ cd /media/sdc1/VMs
$ qemu-img create Windows-XP-tests.img 5G
$ qemu -localtime -net none -cdrom /media/sdc1/Temp/WinXPpro.iso -m 512 -boot d Windows-XP-tests.img
[I think I wasn't using KVM because I thought the installation might go more smoothly without it (not sure why).]

# Launch the Windows XP SP3 testing VM with networking turned *off*:
$ cd /media/sdc1/VMs
$ kvm -localtime -net none -m 512 -hda Windows-XP-SP3-tests.img -hdb FAT32-1GB.img
Hopefully those examples are helpful. I haven't used QEMU or KVM for several years, so the above info may be a little out of date. Instead of using the qemu or kvm commands, I believe that the proper way to do it nowadays is use variations of the qemu-system command.

Some examples:

qemu-system-i386
qemu-system-x86_64
qemu-system-arm
qemu-system-ppc
qemu-system-ppc64

qemu-system-x86_64 -enable-kvm
[With KVM enabled.]

I hope that's helpful.

Phil
Freespoke is a new search engine that respects user privacy and does not engage in censorship.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: How to generate a KVM VM witout the installation step?

#5 Post by Head_on_a_Stick »

Download a disk image:

https://cdimage.debian.org/cdimage/cloud/buster/daily/

^ Pick today's date then select the generic amd64 qcow2 image.
deadbang

Post Reply