212 lines
18 KiB
Plaintext
212 lines
18 KiB
Plaintext
|
|
Episode: 373
|
||
|
|
Title: HPR0373: Qemu
|
||
|
|
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr0373/hpr0373.mp3
|
||
|
|
Transcribed: 2025-10-07 19:18:24
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
We shall see you in the next recipe.
|
||
|
|
Hi everyone, this is Klaxoo, this is HackerPublic Radio, and I'm going to be talking about
|
||
|
|
Kimu today, which no one really knows how to say it seems to be something like Kuyimu
|
||
|
|
or Kuyimu or Kuyimu, but anyway, it's a great little program for emulation.
|
||
|
|
So if you've got simple needs and you want to emulate an OS, you might want to look at
|
||
|
|
Kuyimu, and the reason I looked at it in the first place, well the first reason I looked
|
||
|
|
at it in the first place was because it was free and it was available for the Macintosh
|
||
|
|
and I needed it for the Mac, because I was stuck at work on a Mac needing something to
|
||
|
|
look at as I had from Mac OS, and so that's why I started using it, and there's a Windows
|
||
|
|
version for it, and then there's the Linux version for it.
|
||
|
|
So either way, wherever you need it, you can have it, so that's a nice feature of it,
|
||
|
|
and it's entirely free, it's a free, very free software, there's not a whole lot to
|
||
|
|
be suspicious of, in terms of affiliation with this or that company, it's free software
|
||
|
|
for emulation.
|
||
|
|
I don't do anything fancy with it myself, so in terms of virtualizing some kind of
|
||
|
|
big server kind of OS, so that you can serve lots of little thin clients, I know nothing
|
||
|
|
about that, that's nothing that I've ever done.
|
||
|
|
This is more, at least the reason that I use this is typically I get a magazine, a Linux
|
||
|
|
magazine, and you know they have this or that distro on the DVD that month, to try out
|
||
|
|
that distro I'll fire up Kuyimu, run the command, and try out the distro, or maybe I'm doing
|
||
|
|
like a tutorial or something, or a screencast, they're very handy for that as well, because
|
||
|
|
then you get a clean, isolated, untouched system that you can take screenshots of or record,
|
||
|
|
and you're not recording your own system, so that's what this little application is good
|
||
|
|
for.
|
||
|
|
Their website is at www.kuyimu.org, and you should be able to find it pretty much in any
|
||
|
|
repository that you have going for you, it's certainly in the Fedora repositories and
|
||
|
|
there's a Slack build of it, and certainly in the WN repository, so it should be everywhere
|
||
|
|
you look really, it's a very popular little application.
|
||
|
|
There's a GUI frontend for it, if you need it, although I think you'll find that you
|
||
|
|
don't need it, the GUI frontend for me, I've never been able to get it to work, but it
|
||
|
|
does exist, I haven't really taken the time to troubleshoot it, but I'll set up the machine
|
||
|
|
and try to launch it, and it just doesn't launch for some reason, it just doesn't work,
|
||
|
|
so I think you'll find that the command line stuff is sufficient anyway, the GUI is a
|
||
|
|
little bit, I don't know, excessive somehow, so you can find the GUI though, if you want
|
||
|
|
to try it out at Kimu Launcher, KEMU-Launcher, that is what it's called in the Fedora repository,
|
||
|
|
I haven't looked at it, I haven't looked for it on any other system, but I think it would
|
||
|
|
be called something like that, Kimu Launcher, but like I said, I'm not sure if it's something
|
||
|
|
that you're really going to need, okay, so after you get it installed, you really ought
|
||
|
|
to just look at the, you know, read the man page, man GUI in you, it's a pretty simple
|
||
|
|
man page, and it just gives you a really good idea of all the different options that you
|
||
|
|
have available to you, granted the first time you run it, you might not want to try every
|
||
|
|
single option that looks appealing to you, but at least you'll be familiar with more
|
||
|
|
or less what's available out there, the way I like to come to a new program like this
|
||
|
|
is sort of a, you know, you start the application kind of with a couple of options just so you
|
||
|
|
know sort of that it's working for you, and then go back and start tweaking it, that's
|
||
|
|
the way I typically do it, so, but the man page is informative and it's not overwhelming
|
||
|
|
by any means.
|
||
|
|
Well, one of the very first things you have to do is you need to create a little fake
|
||
|
|
hard drive on your real hard drive, so that Qemu can use that as its emulated hard drive,
|
||
|
|
so you can run a live CD within Qemu, but if you want to install it as a distro on a virtual
|
||
|
|
machine, then you've got to have that little container file that Qemu can look at, think
|
||
|
|
it's a real hard drive, take over format and install the distro onto it.
|
||
|
|
Now this little virtual machine doesn't have to be very large, I don't think I ever really
|
||
|
|
make them any larger than four gigabytes, so the command for that is the basic command
|
||
|
|
is Qemu-img, Qemu-img, that's a little program that creates an image for Qemu, and then
|
||
|
|
you do, so it's Qemu-img space create, space-f as an format, Q-2, that is letter Q, C-O-W,
|
||
|
|
and the number two, space, fedora.q-2, space-4G, fedora there being the distro that I'm pretending
|
||
|
|
like I'm going to emulate right now, could be anything you could call it Qemu.q-2, you
|
||
|
|
could call it slackware.q-2, you know, whatever you're going to emulate, and then the space
|
||
|
|
4G at the end is the four gigabyte definition, now that dash f format Q-2, well Q-2 is the default
|
||
|
|
format for Qemu, that's what they use, it's probably their own little format, I don't
|
||
|
|
know, but that is what you would use for Qemu if you want to know, there are other options
|
||
|
|
if you know that you're going to create it here in Qemu, and then take it out and run it
|
||
|
|
on virtual box or something like that, I've never exported a virtual machine or transferred
|
||
|
|
it or anything like that, so I know nothing about that, but you can certainly look into
|
||
|
|
it if you know that's something that you need, like if you have a site license for some
|
||
|
|
other emulator somewhere, but at home you only have Qemu, I guess there might be the ability
|
||
|
|
to do the work on Qemu, and then take it over to your work, and you know, in the big professional
|
||
|
|
emulator and import all your work, like I say I've never done it, so you also look into
|
||
|
|
that yourself, so let's just do something really simple first, and like I say, typically
|
||
|
|
I do use Qemu, just with the actual CD-RON drive of my computer, because the distro that
|
||
|
|
I'm test driving is just a distro that came with whatever DVD came with Linux format or Linux
|
||
|
|
Pro or Linux identity or whatever magazine I happen to have picked up that day.
|
||
|
|
The simple command for this would be Qemu, Qemu, space-capital-m as in machine, space-PC,
|
||
|
|
space-CPU, space-Qemu32, space-CD-RON, space-slash-dev-slash-CD-RON, space-boot, space-D, space-drive,
|
||
|
|
space-equals, till the slash-Qemu.qcout2, okay so command by command, option by option here,
|
||
|
|
Qemu, that's the application, dash-capital-m is the machine that we're trying to emulate.
|
||
|
|
You can do like a dash-capital-m and then space-question mark, and it will run Qemu up to the capital-m
|
||
|
|
and then it will see the question mark and it will just list all the different kinds of
|
||
|
|
machines that you have to choose from, if you do a CPU, space-CPU, question mark, it'll
|
||
|
|
give you a list, and one of the choices is probably the one that you'll want to choose
|
||
|
|
is Qemu32.
|
||
|
|
Now I'm running this on a 32-bit system, I've never run it on a 64-bit system, I will
|
||
|
|
very soon, there might be other options when you're running 64-bit, I'm not sure, but
|
||
|
|
the best CPU you've got to choose from right now is Qemu32, and then you do dash-space-CD
|
||
|
|
-RON, this is just defining the location of your CD-RON, it can, yes, it can be an ISO file,
|
||
|
|
so if you've downloaded an ISO image of a distro that you want to try and you obviously
|
||
|
|
don't want to burn it to disk in order to just try it out, you can run this just straight
|
||
|
|
from an ISO, which we'll do in a moment, but right now we're doing it off of an actual
|
||
|
|
CD, so that's slash-dev slash-CD-RON, and then you say space-boot, the D option, which
|
||
|
|
we're using here, tells Qemu to boot from the CD-RON rather than, for instance, C, which
|
||
|
|
would be the hard drive or whatever, you know, like in for network, I think, things like
|
||
|
|
that, and then you do the space-drive, this is telling it where the hard drive is, and
|
||
|
|
if you'll recall, the hard drive that we've created for Qemu to use is that we're QKOW2
|
||
|
|
image, so we're just defining where we stored that Qemu.QKOW2 image or Fedora.QKOW2 image,
|
||
|
|
whatever you've called it, generally I have just a Qemu.QKOW2 image in my home folder
|
||
|
|
because I'm rarely keeping these virtual machines on one distro, you know, it's like every
|
||
|
|
couple of times every month, it's getting a new distribution on it, so this is kind of
|
||
|
|
my all-purpose QKOW2 image, I just call it Qemu.QKOW2 image, but if you know that you're
|
||
|
|
emulating a Fedora install or something and you want to call your QKOW2 image Fedora.QKOW2,
|
||
|
|
that would make sense as well. You get the idea, it's up to you what you call the image,
|
||
|
|
just know where you're storing it and you're good to go. Now, after you type in that command,
|
||
|
|
which I guess I could repeat really quick, Qemu.CapitalMPC-CPU-Qemu32-CDROM-DEV-CDROM-BOOT-D-DRIVE-FILLE
|
||
|
|
EQUALS TILDAY-SLASH-Qemu.QKOW2. After you issue that command, a window will appear on
|
||
|
|
your desktop and you will have an emulated host. And first you're going to see it's
|
||
|
|
little emulated BIOS and then it will start booting from the CDROM. Once it's emulated BIOS,
|
||
|
|
recognize it's emulated hardware. And like I say, you can run this thing as a live CD or
|
||
|
|
you could, if you want to play around a little bit more, you can install it right onto your
|
||
|
|
little hard drive. And the emulated machine will think that it is an actual hard drive.
|
||
|
|
You will know that it's not your real hard drive because it's only going to be four gigs
|
||
|
|
or however large you made the drive. But just remember that in an emulated environment,
|
||
|
|
I mean as far as that emulated machine goes, all these little files and stuff that you're
|
||
|
|
throwing at it, that's all it knows about. It never will touch, it doesn't have access to
|
||
|
|
your actual hard drive. So there's really no danger of accidentally formatting your machine,
|
||
|
|
you know. It doesn't work like that. Okay, so let's move on to something that would also be
|
||
|
|
quite, quite common. Maybe you didn't get a DVD with a magazine, you just bit torrented
|
||
|
|
the latest ISO of some hot new Linux release. That is very similar. You should already have a
|
||
|
|
QCOW2 image established. If you don't, you can run the chemo-img command again. But you might want
|
||
|
|
to run chemo now with the ISO as your CD-ROM drive. So remember that in Unix and Linux and Unix
|
||
|
|
like systems, everything is a file. That everything includes CD-ROM drives. So it's just as easy
|
||
|
|
for QMU to look at slash dev slash CD-ROM as it is for it to look at, you know, fedora11.iso.
|
||
|
|
Okay, so here's what we would do if we're pointing it at this new ISO.
|
||
|
|
QMU, space-capital NPC, space-CPU, space-QMU32, space-, lowercase m512, space-USB, space-no-ACPI,
|
||
|
|
space-CD-ROM, space-tilde slash f11-preview-i686-live slash f11-preview-i686-live,
|
||
|
|
dot ISO, space-boot, space-D, space-drive, space-file equals tilde slash chemo dot QCOW2.
|
||
|
|
All right, so your eyes and ears are lasing over this point. Let's just go through it,
|
||
|
|
command by command, or flag by flag. That would be chemo. Again, the application, we're invoking,
|
||
|
|
space-capital NPC. Okay, we're still emulating a PC here, space-CPU, chemo32. Okay, we're not
|
||
|
|
emulating in, you know, a 486 machine, we're emulating like a normal modern processor,
|
||
|
|
chemo32, being the name of it. Space-lowercase m, this I just threw in because now we're getting
|
||
|
|
more elaborate. It has nothing to do with the fact that we're doing an ISO. You can use this
|
||
|
|
with the CD, with an actual CD-ROM as well. I just wanted to throw in some more more controls
|
||
|
|
so that you get an idea of what you can do with chemo. So the dash m, lowercase m, is defining
|
||
|
|
the amount of memory that you want to dedicate to this emulated PC. So I said go ahead and have 512,
|
||
|
|
because on this computer I only have a gig of memory, so I just figure I'll throw 512 at the
|
||
|
|
emulated machine, keep 512 for myself, and hope for the best. That's a little bit low to be honest.
|
||
|
|
You probably don't want to, you're not going to be working on an everyday basis on that kind of
|
||
|
|
RAM I don't think, so you might want to beef up your specs before you try this. I mean, it'll work,
|
||
|
|
it works for me fine, but I don't really do anything in the emulated machine. I just, I look at it,
|
||
|
|
play around a little bit, but if you're going to be using it in real life, you're going to,
|
||
|
|
obviously want a better, a little bit more RAM for it. And then I said dash USB, which is enabling
|
||
|
|
the USB functionality in your emulated PC. Now this is cool. It gets a little bit confusing at
|
||
|
|
times because you'll plug in a USB drive and your emulated machine might try to grab it before
|
||
|
|
your real computer does. Things like that are something to be aware of. I don't actually use it
|
||
|
|
that much, once again, it's just a question of whether you're actually going to use the emulated
|
||
|
|
PC for any real work or not, and I don't, so, but I did at one point, like when I was at work,
|
||
|
|
emulating Linux distros, just to escape, you know, the actual macOS that I had to work in,
|
||
|
|
I used it quite frequently then because I would, I would work in QMU, and then I would want to save
|
||
|
|
my work and bring it back home to use on Linux at home. So it's a cool new, it's a fairly new feature,
|
||
|
|
I'm pretty sure I could be wrong, but I'm pretty sure the USB functionality is more a little bit
|
||
|
|
recent than when I first started using QMU. So there's that option, and there's a lot of other
|
||
|
|
options that you can do. There's video card, sound card, networking, so you can play around with
|
||
|
|
that. Like I say, this is why you'd want to read the the the man page on on QMU. The next option
|
||
|
|
that I did in this big long string that I gave you was a dash no dash ACPI, and that is something
|
||
|
|
that I've found works better for, you know, certain distros. It's just whatever drivers, I guess,
|
||
|
|
are installed or however auto discovers, I don't know, but sometimes it works, you get better results
|
||
|
|
if you do the dash no dash ACPI. Space dash CD run is obviously defining the drive, and this is
|
||
|
|
where we gave it the ISO file, and this is typically, I mean, on my machine it would be tilde slash
|
||
|
|
download slash, and then the folder, which, you know, is usually pretty long, like F11 dash preview
|
||
|
|
dash, I686 dash live, and then the ISO file inside of that folder, so that would be slash F11 dash
|
||
|
|
preview dash, I686 dash live dot ISO, so that's why that was such a long string, and I think I even
|
||
|
|
cut out a folder just to be just for brevity, but you know where you download your ISOs to on your drive,
|
||
|
|
so obviously that's what you're going to be putting in as your CD run. It's that's pretty simple.
|
||
|
|
Again, you need to boot from the CD run drive, so it's the dash boot space D, and then the drive,
|
||
|
|
the hard drive that you want the emulated machine to be aware of is dash drive, and then you
|
||
|
|
define it as a file, so it's space file equals tilde slash, kimu dot qcout2, or whatever you called it.
|
||
|
|
So that's pretty simple if you, again, I mean if you kind of think about each,
|
||
|
|
each option that you're including, think about what you want to get done, it all, it all makes
|
||
|
|
a fair amount of sense. I like it, I like the command line quite a bit, I think it's, it's a very
|
||
|
|
logically done kind of way of starting all this stuff, so I don't think you're going to need
|
||
|
|
the GUI so much. Now, if at any point you've installed your distribution onto your little fake hard
|
||
|
|
drive, your qcout2 image, then you're going to want to start booting obviously not from your CD
|
||
|
|
run drive, but your hard drive. And in that case, you can still define your CD run drive, you can
|
||
|
|
still say dash CD run space dash dev slash CD run, just so that your emulated machine has a CD
|
||
|
|
run drive. It might be nice, maybe you want to pop in a music CD and import it or something
|
||
|
|
onto your emulated machine. So I mean, that's a good option to have, but the boot option, the dash
|
||
|
|
boot space D for, I don't know what it stands for drive, I guess, should not be from the DVD drive
|
||
|
|
or the CD drive, it should be from your hard drive. And to boot from the hard drive, that's dash
|
||
|
|
boot space C. And your different options there are C for hard drive A for floppy, a CD D for the CD
|
||
|
|
drive, and then in I think for network. So you've got quite a few options there, and you can use,
|
||
|
|
and you can, it's not boot, I think it's a, I think it's drive. Yeah, the space dash drive
|
||
|
|
option where you're actually defining the hard drive for the, you know, of the machine, so that
|
||
|
|
would be like, you know, the chemo dot QCow2 or Fedora 11 dot QCow2 or Debian dot QCow2, whatever
|
||
|
|
you called your little QCow2 image, you can, that's the one that you can, well, that is obviously
|
||
|
|
where you're going to be defining. Now that you've said boot from a hard drive, that's the hard drive
|
||
|
|
you want to boot from, that's important. But there are also, you know, there are snapshots and
|
||
|
|
things like that that you can take of your virtual machine. And so when you invoke your, you know,
|
||
|
|
the next time you want to run it, you can, you can start it up from a certain snapshot file.
|
||
|
|
And that kind of stuff is in the man pages. It's, it's, it's simple. It's just a matter of defining
|
||
|
|
what file you want to use for a certain function. And, and it, and it works. So, and like I say,
|
||
|
|
there's lots of options in the man page as well for your network settings, your video card,
|
||
|
|
your sound card, all that other good stuff. So just kind of take a look at the man page,
|
||
|
|
get familiar with, with at least what options are out there. And then you can start playing
|
||
|
|
around with them as, as you start being a little bit more adventurous with, with your emulated
|
||
|
|
machine. And it's getting familiar with the process of emulation is important. If you,
|
||
|
|
if you haven't emulated a machine, you probably should start because it's just something that you,
|
||
|
|
that is obviously kind of something that people expect to become a very, very big deal. In fact,
|
||
|
|
they kind of seem to expect it to become the norm, rather than an exception. So it's something
|
||
|
|
that you might want to look into, kind of start getting familiar with now. The sooner you do the
|
||
|
|
better, because at some point you're going to be dealing with emulated machines, whether you're
|
||
|
|
going to be the network administrator, creating them or a user using them. It is something that you're
|
||
|
|
going to want to know, sort of the back end of and kind of how it works and the ideas behind it.
|
||
|
|
So, um, jump on that. It's called Q, Q, Q, Emu. It is unpronounceable and it's a really cool
|
||
|
|
application. So give it a go. Oh, and thanks for listening. Really, thanks.
|