What does it mean to add a virtual disk image to a virtual CD/DVD drive on a virtual machine? - virtualization

I'm currently installing virtual box, and one of the steps requires that I add a disk image (in my case, an ubuntu ISO file) to a virtual CD/DVD drive listed under the virtual machines Storage.
From what I understand the ISO basically contains all the contents of ubuntu. And once I've allocated enough disk space for my virtual machine, I need to install ubuntu by reading from this ISO file into my virtual hard drive.
So- is that the reason why I need to add the ISO image to my dvd/cd? Because it acts as an ACTUAL cd/dvd? My understanding is limited - I just want more clarification about this process!

.iso files are images of the entire content of a CD. They are meant to be burnt on a actual CD. But there are now several programs allowing to read the content of an .iso file without actually writing the data to a CD.
You're right in everything you said.
Virtual Box simulates (almost) everything of a real computer: disks, drives, memory, USB ports...
The drive is initially empty, i.e. has no CD/DVD inside.
Then you choose which CD should be simulated inside the drive. It can be either the actual CD on your physical machine, or a CD image, i.e. a .iso file.
When some program inside the virtual machine wants to access the data written on what it thinks is the CD, Virtual Box reads the .iso file and answer the program, as if the data came from a CD.

Virtual box uses virtual drives. These drives act as 'actual' drives on the guest OS, in your case Ubuntu would be the guest OS.
When you create a new virtual machine, it is clean, nothing has been installed yet.
In order to install Ubuntu on the machine you will need to load the ISO image into the virtual CD/DVD drive to install it.
Note: A ISO is a 'disk image' that contains the entire contents of a disk in a single file, that can be loaded into virtual drives, or burned to physical CD/DVDs
Here is a small tutorial on install Ubuntu to virtual box, the screen shots may differ a little bit, but the process will generally be the same for you.
http://osxdaily.com/2012/03/27/install-run-ubuntu-linux-virtualbox/

Related

Copying updated Files between Networks

Is there a way that I can copy updated files only from one network to another? The networks aren't connected in anyway, so the transfer will need to go via CD (or USB, etc.)
I've had a look at things like rsync, but that seems to require the two networks to be connected.
I am copying from a Windows machine, but it's going onto a network with both Windows and Linux machines (although Windows is preferable due to the way the network is set up).
you can rsync from source to the use-drive, use the usb-drive as a buffer, and then rsync from the usb-drive to the target. to benefit from the rsync algorithm and reduce the amount of copied data you need to keep the data on the usb-drive between runs.

VHD (Virtual PC) - how to force a Startup regardless of changed VHD

I am using a virtual machine to automate the execution of integration tests for a server-based product.
I am using "Windows XP Mode and Virtual PC" on a developer machine.
I am doing everything using PowerShell. I wish to:
mount the VHD (diskpart)
copy the release package onto the VHD file system
dismount the VHD (diskpart, again)
Start the VM
It is all fine as long as I don't do 2. If I change the VHD file system at all then 4. fails silently.
If I then go to the Virtual Machines on the Host and start the VM up using the GUI I get a warning:
"Inconsistency in virtual hard disk time stamp detected"
"The virtual hard disk's parent appears to have been modified"
I suspect there is a security feature in here (would make sense). But in my case this feature is not desirable.
Anyone know how to disable the timestamp checking or set the timestamp after I unmount the VHD (before?) ...?
EDIT: Look at the Startup2() options ... method takes one parameter, one of which says:
vmStartupOption_FixParentTimestampMismatch = 1
... from:
Microsoft method details
As per my edit - there is a Startup2() method that takes a parameter that says to ignore the timestamp.

Is it possible to write MBR of a pen drive by any hex editor?

After creating the boot loader, if I copy the bytes of the boot loader and paste it on the 1st 512 bytes of the pen drive using a hex editor, will it work? (Actually I want to learn creating an operating system from scratch.)
I'm not entirely sure I understand your question, but to answer the title: yes. You can write to any part of the drive with an appropriately-designed hex editor with appropriate permissions (usually "sudo" access is required on Linux).
For instance, writing to the boot sector of a flash drive is necessary for automating booting of the CHDK system.
Not all hex editors are designed to access drives, some can only work with files. For instance, the NCurses Hexeditor normally works only with files, but can be made to access disks as files in Linux/Unix environment by employing the -d flag.
The Linux dd command also enables low-level writing to drives. This may be useful in your case as it can be used to perform byte-by-byte copies of drive contents, including MBR sections.
Do not know about HEX editors, but looks like on Windows you can try to CreateFile with name like this \\.\PHYSICALDRIVE0 or just \\PHYSICALDRIVE0. And alter them with WriteFile (with caution!!! otherwise you can damage your OS install or other data).
You can probably figure out device name with WinObj. Also take a look at this project and this question.

Convert Parallels VM to Virtual PC 2007 VM

I'd like to convert a Parallels Virtual Machine image on my mac into an image usable by Virtual PC 2007. Does anyone know how to do that, or if it is possible?
It looks like qemu-img from qemu can do this, at least looking at its commandline help on a Ubuntu 8.04 machine where it claims support for, among others, the "parallels" and the "vpc" format.
Have not tried myself, though. Hope this helps.
If it's a Windows image, I would mount the VM using a tool like SmartVDK, then capture the VM with ImageX to a WIM file. You can then mount a blank VHD with SmartVDK and apply the image using ImageX /APPLY.
The qemu-img tool is better if you're performing the conversion on a Mac or Linux machine.
Keep in mind that you will probably encounter difficulties booting the drive if the drive serials have changed. Also, the hardware will be different. It is often better to build a new image and then to mount the converted drive, copying over anything else you need.

Expanding Virtual Disk [closed]

Closed. This question is off-topic. It is not currently accepting answers.
Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed 9 years ago.
Improve this question
Hey everyone, I'm using Virtual PC and working with a virtual hard disk (*.vhd) that is only sized at 8.2 GB. I would like to double the size to something like 16-20GB. I see options for compacting the VHD but nothing to expand it. It's set to "dynamically expand" but I'm installing some software and it doesn't seem to resize itself to a larger space.
Thanks much.
Heres my solution, using VHDResizer and DISKPART on a Windows XP host.
Download VHDResizer from hereFollowing these instructions from "Murnic" on this thread didnt work, on entering EXTEND, not sure on the exact wording now, but it was along the lines of cant extend this volume.
The easiest way to do this (as long as you have enough hard drive space) is to extend your existing VHD using VHD Expander which gives you two VHD files. The newly extended file will take the name of your existing VHD. You might want to Defragment, Precompact, and Compact your VHD prior to extending your VHD. In Virtual PC 2007 go to Settings. Select your OLD VHD as Hard Disk 1Select your newly extended VHD as Hard Disk 2Boot your VMOpen an Command PromptRun diskpartFrom DISKPART>
- Execute LIST VOLUME
- Select your new VHD volume by executing SELECT VOLUME where is your new VHD most likely 2
- Execute EXTEND
- You should see a success message. If not you may have to recreate your extended VHD due to an error in the process.Quit Diskpart.exe by typing EXITShut Down the VMRemove both VHD files from the Hard Disks listAdd your newly extended VHD as Hard Disk 1Boot your VM.You will get a Windows Newly Added Hardware message after a short time.Reboot the VM when promptedStart using your newly extended VHD! Here is Microsoft's information on extending volumes using Diskpart.exe: http://support.microsoft.com/kb/325590
So I went back to these instructions from 'AutoSponge' at the start of the same thread,
Mount the image
C:>Program Files\Microsoft Virtual Server\Vhdmount>vhdmount /m “C:Documents and Settings\All Users\Documents\Shared Virtual Machines\.vhd”
Start diskpart and expand the partition
C:>Program Files\Microsoft Virtual Server\Vhdmount>diskpart
DISKPART>list disk
DISKPART>select disk 3 -----check the number in the list
DISKPART>list part
DISKPART>select part 1 -----check the number in the list
DISKPART>extend DISKPART>list part -----check the new size
DISKPART>exit
Dismount and save changes
C:>Program Files\Microsoft Virtual Server\Vhdmount>vhdmount /u /c “C:Documents and Settings\All Users\Documents\Shared Virtual Machines\.vhd”
You can get download Microsoft Virtual Server here.
You can do a custom install and only select VHDMount
Some more information using VHDMount
Using VHDMount with Windows XP -
It is not possible to use '/m' (Mount), you can only use '/p' (Plug in).
The reason for this is that VHDMount uses VDS (the Virtual Disk Service) to assign a disk letter to the virtual hard disk after it is mounted, but VDS is only included in Windows Server 2003 and later. This is not too big of an issue though, as unlike Windows Server 2003, Windows XP will automatically mount the virtual hard disk when it is plugged in. This means that the only functionality you lose on Windows XP is the ability to specify exactly which drive letter should be used.
VHD Resizer
Never worked with Virtual PC but from other virtualization software I know I guess that dynamically expand means that initially the .vhd file will take less space in the HD than the specified and will dynamically grow as you keep installing programs or adding files into the virtual drive UP TO the specified size.
For what you want I guess that you will have to modify the specified size in the virtual hard drive from Virtual PC's setup window.
A bit offtopic but give a go to Virtual Box: www.virtualbox.org
For vmware users, you can download a free edition of vmware converter which not only lets you resize virtual disks but also lets you convert from physical to virtual machines and vice-versa.
Here is a solution that worked for me:
Use "CopyWipe" or a similar software to make a hardcopy to a new vhd, as described here:
Eric Cosky
I found it easier, simpler and safer to just create a second VHD and install my Big Software to that HD.
First detach the VHD then run those commands to expand your disk:
diskpart
Select vdisk file="Your Path"
list vdisk
expand vdisk maximum=new size in MB
attach vdisk
list disk
online Disk
list volume
select volume #
extend
list Volume
detach vdisk
exit
And here's a brief description for what each line does:
Launch the DiskPart utity.
Select the VHD file. Notice that if the path or the file name has spaces you have to put double quotes around it.
Shows you a list of Vdisks. The * at the left shows the one that is selected.
Changes the size of the vdisk to our new size.
Once the disk is expanded you have to mount it to work on the disk.
Shows the list of disks mounted disks and vDisks including ours.
If disk is not showing online you will need to bring it online.
List volumes(partitions). The ### column is the most important since it has the number you need to use to select the volume you will work with.
Select the volume we want to work with.
Extends the currently selected volume to use all contiguous available space on the same disk.
Running again to show the new size.
Dismounts the Vdisk volume so that Hyper-V can load it.
Exit diskpart utity.
However I give no guarantee this will work for everyone so keep the original around until you complete the process, just in case.