Share Data Between Windows Server and Hyper-V Using VHDX Files

1. Creating a VHDX File on the Host:

Open Hyper-V Manager:

  • On the Windows Server host, search for and open “Hyper-V Manager”.

Create a New Virtual Hard Disk (VHDX):

  • In the right-hand action pane, choose “New” > “Hard Disk…”, to start the new virtual hard disk wizard.
  • Select the VHDX format, specify its size and save location (e.g., D:\Shared.vhdx).

Complete the Wizard:

  • Finish the wizard, ensuring you choose fixed size for better performance instead of dynamic expansion.

2. Attaching the VHDX File on the Host:

Open Disk Management:

  • Search for “Disk Management” or open it by running diskmgmt.msc.

Attach the VHDX File:

  • In the Disk Management menu, choose “Action” > “Attach VHD…”, select and attach the newly created VHDX file (D:\Shared.vhdx).
  • Initialize, partition, and format the VHDX file upon first attachment.
  • After this, the VHDX file will appear like a regular disk and can be written to.

3. Attaching the VHDX File to the Ubuntu Virtual Machine:

Open Hyper-V Manager:

  • Make sure to save any pending files and shut down the target virtual machine, and also unmount shared folder (as cannot use it meanwhile) in Windows Server side.

Access Virtual Machine Settings:

  • Right-click the target virtual machine and select “Settings”.
  • In the hardware section of the virtual machine, choose “SCSI Controller” or “IDE Controller” and click “Add Hard Drive…”.

Select the VHDX File:

  • In the pop-up dialog, choose “Use an existing virtual hard disk”, select the VHDX file created earlier (e.g., D:\Shared.vhdx).
  • Click “Apply” to save the changes.

4.confirm the VHDX File in Ubuntu:

Use the lsblk command in the terminal to check the new hard disk device.

留下评论

通过 WordPress.com 设计一个这样的站点
从这里开始