LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Riddle Me This...? (https://www.linuxquestions.org/questions/linux-newbie-8/riddle-me-this-718752/)

linus72 04-13-2009 06:17 AM

Riddle Me This...?
 
I've read tutorials where you can use Qemu to create a VHD of whatever size-No, I'm not talking about Qemulator-I'm saying they were using the terminal, with something like- "qemu-img -f create mydisk.img 500m" or something like that...
I can't find the tutorial now, but does anyone know how this is done?
I checked the Qemu site, but couldn't really find anything.
Can a VHD you make using qemulator be moved from wherever it is and still work?
Thanks

repo 04-13-2009 06:27 AM

Do you mean something like this ?

To create the VHD
Code:

qemu-img create -f qcow windows.img 5G
To start qemu with the created VHD
Code:

qemu -localtime -cdrom /home/repo/data/iso/win2000.iso -m 384 -boot d windows.img

linus72 04-13-2009 06:31 AM

That's great-where is that info found...?
Also-where will it creat this img-don't I have to give it a path?
What Linux systems have this Qemu? I have Qemulator and Qemu-Launcher-can I do it with them?
Thanks

repo 04-13-2009 06:42 AM

Quote:

Also-where will it creat this img-don't I have to give it a path?
In general I cd to where I want to create the VHD
Quote:

What Linux systems have this Qemu? I have Qemulator and Qemu-Launcher-can I do it with them?
All of them I think, just install qemu
Debian has it in the repo's, dunno for other distro's

Quote:

That's great-where is that info found...?
Don't remember, had it in my logbook I keep with this kind of thingies

linus72 04-13-2009 06:48 AM

MMMMmmm...I read in the tutorial I can't find that you can make the VHD with a specific filesytems-like FAT32 or swap-is that true- or what is the inside of the VHD?
Is that done when you make the img or you somehow partition/format it?
Thanks again

linus72 04-13-2009 07:18 AM

OK-tried what you said and the commands are incomplete-
Code:

qemu-img version 0.9.1, Copyright (c) 2004-2008 Fabrice Bellard
usage: qemu-img command [command options]
QEMU disk image utility

Command syntax:
  create [-e] [-6] [-s] [-b base_image] [-f fmt] filename [size]
  commit [-f fmt] filename
  convert [-c] [-e] [-6] [-s] [-f fmt] filename [filename2 [...]] [-O output_fmt] output_filename
  info [-f fmt] filename

Command parameters:
  'filename' is a disk image filename
  'base_image' is the read-only disk image which is used as base for a copy on
    write image; the copy on write image only stores the modified data
  'fmt' is the disk image format. It is guessed automatically in most cases
  'size' is the disk image size in kilobytes. Optional suffixes 'M' (megabyte)
    and 'G' (gigabyte) are supported
  'output_filename' is the destination disk image filename
  'output_fmt' is the destination format
  '-c' indicates that target image must be compressed (qcow format only)
  '-e' indicates that the target image must be encrypted (qcow format only)
  '-6' indicates that the target image must use compatibility level 6 (vmdk format only)
  '-s' indicates that the target image must use of type SCSI (vmdk format only)

Supported format: parallels qcow2 vvfat vpc bochs dmg cloop vmdk qcow cow host_device raw

Can you give me an exaample?
For the input name-can I use a folder?

repo 04-13-2009 07:23 AM

repo@cannabis:~$ cd temp
repo@cannabis:~/temp$ ls
repo@cannabis:~/temp$ qemu-img create -f qcow windows.img 5G
Formatting 'windows.img', fmt=qcow, size=5242880 kB
repo@cannabis:~/temp$ ls
windows.img
repo@cannabis:~/temp$

linus72 04-13-2009 07:36 AM

Nope-it just give me the same readout as above^

Some command is still missing-input folder, etc?

repo 04-13-2009 07:40 AM

Could you post the exact command you are using ?

linus72 04-13-2009 07:52 AM

The readout-

Code:

root@bz-desktop:/home/bz# cd /tmp
root@bz-desktop:/tmp# ls
gconfd-bz      pulse-bz        Tracker-bz.5918
keyring-MFmj4S  seahorse-XKZAP8  virtual-bz.CaEgke
orbit-bz        tmp.folaEc5646
root@bz-desktop:/tmp# qemu-img create -f qcow windows.img 5m
qemu-img version 0.9.1, Copyright (c) 2004-2008 Fabrice Bellard
usage: qemu-img command [command options]
QEMU disk image utility

Command syntax:
  create [-e] [-6] [-s] [-b base_image] [-f fmt] filename [size]
  commit [-f fmt] filename
  convert [-c] [-e] [-6] [-s] [-f fmt] filename [filename2 [...]] [-O output_fmt] output_filename
  info [-f fmt] filename

Command parameters:
  'filename' is a disk image filename
  'base_image' is the read-only disk image which is used as base for a copy on
    write image; the copy on write image only stores the modified data
  'fmt' is the disk image format. It is guessed automatically in most cases
  'size' is the disk image size in kilobytes. Optional suffixes 'M' (megabyte)
    and 'G' (gigabyte) are supported
  'output_filename' is the destination disk image filename
  'output_fmt' is the destination format
  '-c' indicates that target image must be compressed (qcow format only)
  '-e' indicates that the target image must be encrypted (qcow format only)
  '-6' indicates that the target image must use compatibility level 6 (vmdk format only)
  '-s' indicates that the target image must use of type SCSI (vmdk format only)

Supported format: parallels qcow2 vvfat vpc bochs dmg cloop vmdk qcow cow host_device raw
root@bz-desktop:/tmp#

You see-it needs more input as what to do-as with all things terminal-the proper commands and usage examples are vague, badly written and would require an astronaught to figure out.
The Linux world needs to drop the esoteric and presumptuous attitude that the avg joe could decipher that "man" page above.
One needs clear examples with the full understanding that I am a Newbie.
thanks

repo 04-13-2009 07:54 AM

try
Code:

qemu-img create -f qcow windows.img 5M
size' is the disk image size in kilobytes. Optional suffixes 'M' (megabyte)
and 'G' (gigabyte) are supported

linus72 04-13-2009 07:58 AM

Code:

root@bz-desktop:/tmp# qemu-img create -f qcow windows.img 5m
That's the exact command I used above and from the qemu page-same result-it just lists the man page-which is no help

repo 04-13-2009 08:00 AM

replace
Code:

5m
with
Code:

5M

linus72 04-13-2009 08:10 AM

OK-I got it working-Now can I install the iso it's running off of into the vhd ".img"??
If yes-do I partition and format it from within the iso I boot?
Thanks again repo

repo 04-13-2009 08:16 AM

now type
Code:

qemu -localtime -cdrom /path-to/dsl-4.4.10.iso -m 384 -boot d windows.img
this will start dsl-4.4.10.iso in qemu, using the created VHD
The VHD is just an image file, you cannot partition or format it, it is virtual.


All times are GMT -5. The time now is 07:11 AM.