VMWare File Format Learning && Use VHD File To Boot VMWare

目录

1. Virtual Machine Introduce
2. Vmware Image File Format
3. VHD File Format
4. Convert VHD File Into VMDK
5. Run Virtual PC virtual machine in VMware Workstation

1. Virtual Machine Introduce

A virtual machine (VM) shares physical hardware resources with other users but isolates the operating system or application to avoid changing the end-user experience.

A virtual machine (VM) is an operating system OS or application environment that is installed on software which imitates dedicated hardware. The end user has the same experience on a virtual machine as they would have on dedicated hardware.

Vm diff from Physic Machine

1. Non-virtualized computers
they load and execute hundreds or thousands of individual files, including operating-system kernel files, device drivers, application components and data files.

2. Virtualization abstracts the software from the underlying hardware and puts all the constituent data for a given virtual machine (VM) in a single disk file. The disk file is essentially a complete and independent virtual machine. 

Relevant Link:

http://searchservervirtualization.techtarget.com/definition/virtual-machine
http://whatis.techtarget.com/fileformat/VMDK-Virtual-Machine-Disk-file-for-VMware-virtual-machines

2. Vmware Image File Format

1. .vmx: 虚拟机名称.vmx
存储虚拟机设置的主要配置文件。如果虚拟机是使用之前版本的 Workstation 在 Linux 主机上创建的,这类文件的扩展名可能为 .cfg

2. .log: 虚拟机名称.log or vmware.log
主要日志文件。如果您需要排除某个问题,可以参考该文件。该文件与 .vmx 文件存储在同一个目录中 

3. .nvram: 虚拟机名称.nvram or nvram
NVRAM 文件,用于存储虚拟机 BIOS 的状态。该文件与 .vmx 文件存储在同一个目录中 

4. .vmdk
    1) 虚拟机名称.vmdk
    虚拟磁盘文件,用于存储虚拟机硬盘驱动器的内容。这些文件与 .vmx 文件存储在同一个目录中
    一个虚拟磁盘由一个或多个虚拟磁盘文件构成。虚拟机设置显示集中第一个文件的名称。该文件包含指向集中其他文件的指针。
    如果您指定在创建虚拟磁盘时分配所有的磁盘空间,这些文件一开始就会是最大大小,之后也不会再增长。文件中几乎所有的内容都是虚拟机数据。有一小部分文件会分配用于虚拟机开销
    如果虚拟机直接连接到物理磁盘,虚拟磁盘文件将存储有关虚拟机可访问分区的信息 

    2) 虚拟机名称-s###.vmdk
    如果指定文件大小可以增加,文件名的文件编号部分将包含一个 s,例如 Windows 7-s001.vmdk。
    如果您指定将虚拟磁盘拆分为 2 GB 大小的文件,文件数量取决于虚拟磁盘的大小。随着数据被添加到虚拟磁盘,每个文件最大可以扩至 2 GB 

    3) 虚拟机名称-f###.vmdk
    如果在创建磁盘时分配了磁盘空间,文件名中将包含一个 f,例如 Windows 7-f001.vmdk 

    4) 虚拟机名称-磁盘-###.vmdk
    如果虚拟机有一个或多个快照,则会有一些重做日志文件。这些文件存储虚拟机运行期间对虚拟磁盘所做的更改。### 表示 Workstation 为避免文件名重复而添加的唯一后缀

5. vmem
    1) uuid.vmem
    虚拟机分页文件,用于在主机文件系统上备份客户机主内存。该文件只在虚拟机运行或发生故障时存在。它存储在工作目录中。

    2) 快照名称及编号.vmem
    已开启虚拟机的每个快照都有一个关联的 .vmem 文件,该文件保存为快照的一部分,包含客户机操作系统的主内存 

6. .vmsd: 虚拟机名称.vmsd
用于集中存储快照相关信息和元数据的文件。它存储在工作目录中 

7. .vmsn: 虚拟机名称.Snapshot.vmsn
快照状态文件,用于存储拍摄快照时虚拟机的运行状态。它存储在工作目录中 

8. .vmss: 虚拟机名称.vmss
挂起状态文件,用于存储挂起虚拟机的状态。它存储在工作目录中 

9. 其他文件(如锁定文件)也可能存储在虚拟机目录中。某些文件只在虚拟机运行期间出现 

Relevant Link:

http://pubs.vmware.com/workstation-10/index.jsp?topic=%2Fcom.vmware.ws.using.doc%2FGUID-A968EF50-BA25-450A-9D1F-F8A9DEE640E7.html
https://www.vmware.com/support/ws5/doc/ws_learning_files_in_a_vm.htm

3. VHD File Format

The Virtual Hard Disk (VHD) format is a publicly-available image format specification that allows encapsulation of the hard disk into an individual file for use by the operating system as a virtual disk in all the same ways physical hard disks are used. These virtual disks are capable of hosting native file systems (NTFS, FAT, exFAT, and UDFS) while supporting standard disk and file operations. VHD API support allows management of the virtual disks. Virtual disks created with the VHD API can function as boot disks.

VHD files are used in

1. Hyper-V
2. Windows 7 && Windows Server 2008
3. Virtual Server
4. Windows Virtual PC

These products use the VHD API to contain the Windows operating system image utilized by a virtual machine as its system boot disk.

summary

1. User Mode Native Windows APIs:
    1) VirtDisk.dll: Common library for VHD management APIs.

2. User Mode Domain: specific Management Wrappers
    1) VDS VHD APIs: VDS Object Model wrappers for the VHD Windows APIs.

3. Kernel Mode Drivers:
    1) VDrvRoot.sys: Root virtual drive enumerator.
    2) FsDepends.sys: Nested volume dependency management.
    3) Vhdmp.sys: VHD parser and dependency property provider.

Relevant Link:

http://msdn.microsoft.com/ZH-CN/library/windows/desktop/dd323654(v=vs.85).aspx

4. Convert VHD File Into VMDK

Virtual PC uses its own virtual disk image format called Virtual Hard Disk (.vhd file extension) that stores file system, operating system data, users files and folders like on physical disk. VHD format is also used by Microsoft backup applications and Windows Server operating systems.

我们需要将这个VHD文件转换为Vmware兼容的格式,并加载到Vmware上

0x1: Download、Instanll Winima

http://www.winimage.com/download.htm
Name: crsky
Code: 1353A9B 

0x2: Convert

Select: Convert Virtual Hard Disk image..

Select: Create Fixed Size Virtual Hard Disk

Select, Safe as: VMware VMDK (*vmdk), select target location and type the new (.vmdk) file name

转换完成

0x3: Create A VM With Converted VMDK File

我们已经完成了将CoreOS的VHD文件转换为VMDK文件,但是我们知道,这个VMDK是一个虚拟磁盘文件,并不是一个可以直接启动的虚拟机。在这个VMDK文件中,包括了Boot引导启动CoreOS的主程序

接下来可以新建一个VM,并挂载VMDK镜像文件

Relevant Link:

http://blog.vmpros.nl/2012/02/21/vmware-convert-vhd-to-vmdk-with-winimage/
http://www.file-extensions.org/article/run-virtual-pc-machines-in-vmware-workstation
http://www.sqlpanda.com/2012/04/run-windows-2008r2-vhd-under-vmware.html

除此之外,也可以直接使用工具基于VHD创建一个新的VM

http://www.vmware.com/products/converter/?PID=6146957&PubCID=2470763

5. Run Virtual PC virtual machine in VMware Workstation

VMware也支持直接使用VHD文件启动

0x1: 设置Intel VT-x

如果你要挂载的VM镜像是64位的操作系统,我么需要将CPU的VT-x开关打开,在开机启动的BIOS中设置

http://www.jianhui.org/his-host-supports-intel-vt-x-but-intel-vt-x-is-disabled-issue.html

0x2: 创建64位的Linux 2.6.x操作系统

通过VMware Wizard创建一个不带操作系统ISO文件的VM,不采用ISO中的操作系统,而是采用我们挂载的虚拟硬盘中的操作系统进行引导

0x3: 将VHD文件挂载到新建的VM上

0x4: 运行

VM创建好,并挂载了VHD之后,就可以直接启动VMware了

Copyright (c) 2014 LittleHann All rights reserved

时间: 2024-08-27 02:25:01

VMWare File Format Learning && Use VHD File To Boot VMWare的相关文章

The Portable Executable File Format from Top to Bottom(每个结构体都非常清楚)

The Portable Executable File Format from Top to Bottom Randy KathMicrosoft Developer Network Technology Group Created: June 12, 1993 Click to open or copy the files in the EXEVIEW sample application for this technical article. Click to open or copy t

JVMS Specification(3)-The class File Format

Subsections 3 The class File Format 3.1 The ClassFile Structure 3.2 The Internal Form of Names 3.2.1 Binary Class and Interface Names 3.2.2 Unqualified Names 3.3 Descriptors and Signatures 3.3.1 Grammar Notation 3.3.2 Field Descriptors 3.3.3 Method D

Unity64 AStarPath 寻路失效 Bug解决 IOS64 IL2CPP - Bad date/time format in the zip file

把游戏项目迁移到IOS64 上面又出现了自动寻路无效的BUG,在XCode Console中有提示AStarpath异常, Bad date/time format in the zip file 在代码中查询得知是AStarpath在初始化时,会读取场景的寻路信息文件,但是由于DonetZip中的一个解析时间的Bug,导致异常,从而没有读取到场景自动寻路信息. 文章来自播客 http://blog.csdn.net/huutu文章来自播客 http://blog.csdn.net/huutu

ShopEx访问提示Incompatible file format: The encoded file has format major ID 2, whereas the Loader expects 4

今天测试了下ShopEx程序,但是ShopEx安装时(程序放在public_html目录下的test目录中)遇到了问题,提示错误如下:Fatal error: Incompatible file format: The encoded file has format major ID 2, whereas the Loader expects 4 in /home/cpusername/public_html/test/core/include_v5/defined.php on line 0检

Java class file format specfication

Java class file format spec Link: https://docs.oracle.com/javase/specs/jvms/se7/html/jvms-4.html Here is an example: -----------------------------------------------------java source file---------------------------------------------------------public

MySQL错误Incorrect file format解决方案

一台mysql 服务器,机器意外重启后,N个表报错,想必你已经知道库的引擎是myisam 的了,太悲催,太蛋碎了,先看看报错信息: mysql> desc PARTITION_KEYS; ERROR 130 (HY000): Incorrect file format 'PARTITION_KEYS' mysql> check table PARTITION_KEYS; +-------------------------+-------+----------+----------------

解决strip: Unable to recognise the format of the input file问题

前言 在编译xilinx的uboot的时候出现了一个问题,始终报错:"strip: Unable to recognise the format of the input file `gen_eth_addr'" 1 分析 一般对于编译链接命令出现这样的错误,都是因为目标文件和命令的编译环境不一样导致的,但是我看了一下对于这个目标文件gen_eth_addr,使用的gcc进行编译的啊,为什么strip就不会认识呢? 在第一反应中,gcc/strip都应该是使用的系统安装是/usr/bi

3ds Max File Format (Part 1: The outer file format; OLE2)

The 3ds Max file format, not too much documentation to be found about it. There are some hints here and there about how it’s built up, but there exists no central documentation on it. Right now we are in the following situation. A few thousand of max

Does the OpenSceneGraph have a native file format?

From OpenSceneGraph-3.0 onwards we have new native file formats based on generic serializers that are extensible and support forward/backward compatibility, there is a .osgt ascii text file format, .osgx xml format and .osgb binary format. The extens