📜 ⬆️ ⬇️

Transfer CentOS5 from VirtualBox to Hyper-V and install Linux Integration Services



Hello.

1. Starting the transfer, first convert the .vdi hard disk from VirtualBox to the .vhd Hyper-V disk

- In the VirtualBox directory, execute the command to convert the .vdi image to .raw
VBoxManage.exe internalcommands converttoraw d: \ project \ project.vdi d: \ project.raw
')
- We are looking for and install WinImage, launch, select Disk -> Convert Virtual Hard Disk Image,
file type *. *, open the .raw image, save as a dynamically expandable .vhd image

2. Create a new virtual machine in Hyper-V, use the Legacy network card, since the synthetic network card will not work until you install Linux Integration Services.

3. Remove VirtualBoxAdditions from CentOS
in the /etc/init.d/ directory
by team
chkconfig --del "vboxadd"
chkconfig --del "vboxadd-service"
chkconfig --del "vboxadd-x11"
Then we delete these files from the /etc/init.d directory (vboxadd, vboxadd-service, vboxadd-x11)

4. Go to the Hyper-V settings, set the mac mac address of the network card
Then in Linux we follow the path
/ etc / sysconfig / network-scripts /
edit the ifcfg-eth0 file (or ifcfg-seth0) and write by analogy:
DEVICE = eth0
BOOTPROTO = static
BROADCAST = 10.10.10.255
HWADDR = 00: 01: 02: 03: 04 (take from the hyper-v settings)
IPADDR = 10.10.10.10
NETMASK = 255.255.255.0
NETWORK = 10.10.10.0
ONBOOT = yes

or we can do it even easier, launch it in the system-config-network-tui console and configure eth0 (physical adapter) or seth0 (synthetic adapter).
Rebooting Linux.

5. We update CentOS, we type in the console:
yum update
yum groupinstall "development tools"
reboot

6. Download Linux Integration Services v2.1 for Windows Server 2008 Hyper-V R2 , unpack and mount .iso in a virtual machine in the hyper-v window.

The installed Linux Integration Services gives us:
- Driver support for synthetic devices - synthetic ethernet adapter, faster than legacy erhernet
- Fastpath Boot Support for Hyper-V - faster loading of the virtual machine
- Timesync - time synchronization with the host machine
- Integrated Shutdown - the ability to disable Linux from the hyper-v snap-in
- Symmetric Multi-Processing (SMP) Support - support for up to 4 processors
- Heartbeat - the ability to monitor the status of the guest OS
- Pluggable Time Source

From unrealized:
- Integration Services: Data Exchange, Volume Snapshot Backup
- Networking: Jumbo Frames and TCP Offload
- Storage: Hot Add / Remove (VHD s and Passthrough Disks)

7. Mount Linux Integration Services v2.1 ISO:
mkdir -p / mnt / cdrom
mount / dev / cdrom / mnt / cdrom

Copy files to hard disk:
mkdir / opt / linux_ic
cp -R / mnt / cdrom / * / opt / linux_ic
umount / mnt / cdrom

Install Linux Integration Services,
cd / opt / linux_ic
make
make install


Do not reboot yet. If you have RedHat5.5 (and we have CentOS 5.5), then you need to go to
/boot/grub/grub.conf file and change hda = noprobe hdb = noprobe to ide0 = noprobe ide1 = noprobe . If you do not fix grub, then we will catch a kernel panic after a reboot:

We reboot the console and enjoy CentOS 5.5 working correctly under Hyper-V.

PS:
Underwater rocks:
1. At first, I could not understand why Linux, when booting, does not cling to the hyper-v network card, google prompted that you need to first use the legacy network card.
2. According to the instructions that came with Linux Integration Services v2.1, nothing worked until the magic yum groupinstall “development tools” magic command was added, the package lacked these developer tools, and at the same time the kernel was fresher.
3. Finally put LIS, a joyful reboot and ... kernel panic. A thoughtful reading of the documentation suggested that you need to edit the grub.

Source: https://habr.com/ru/post/105354/


All Articles