Talk:Moving an existing install into (or out of) a virtual machine

From ArchWiki
Latest comment: 26 June 2020 by YuGiOhFan2020 in topic Ext2FSD is (probably) deprecated

Migrate Arch from virtual machine to hardware

Content from HOWTO: Migrate Arch from virtual machine to hardware that should be tested and then merged into this page:

This is a summary of the following forum topic: https://bbs.archlinux.org/viewtopic.php?id=92528

When you installed an Arch system inside a virtual machine and want to move it to work on the hardware machine, follow these steps:

  1. Download, burn a LiveCD and boot from it (in this example Ubuntu)
  2. Install vdfuse[1]. (may well be in Ubuntu repos, I didn't check. I know it's in Arch's AUR somewhere)
  3. Mount the VDF disk file somewhere (we will call it directory A)
  4. Prepare the target partition (the future root partition for migrated system) by making sure it's empty. I'm not sure if that's necessary, but I'd do it just in case and to simplify the process. Mount it somewhere. We will call this directory B.
  5. Copy the contents of directory A to directory B using "cp -a" (remove quotes)
  6. Adjust /etc/fstab in directory B and if you use GRUB below 2.0 adjust /boot/grub/menu.lst as well.
  7. Reinstall GRUB onto the partiton mounted as directory B. Make sure you install it to the correct partition, errors may render the system unbootable.
  8. Chroot into directory B and run "mkinitcpio -p kernel26" (remove quotes). If you forget to do that, the target system may not work properly or don't boot at all.
  9. Cross your fingers and reboot. Hope everything works as expected.

IMPORTANT! This haven't been tested yet. Do it at your own risk. As usual, there is no guarantee whatsoever that this will work. Don't blame me if instructions above will cause any mayhem.

-- pointone 16:11, 10 June 2011 (EDT)

Mounting a partition inside a raw disk image

While moving my system into a VM, after partitioning the image, I had to use kpartx to create a device for the newly created partition, as described in QEMU#Mounting_a_partition_inside_a_raw_disk_image. If this step is normally required we should add it to the instructions here. Cmatteri (talk) 18:14, 13 August 2015 (UTC)Reply[reply]

libgl

I had to replace nvidia-libgl with mesa-libgl to start xorg in virtualbox. That is probably worth mentioning. It's easy to forget about nvidia-libgl, even if you remove the nvidia driver. Cmatteri (talk) 23:35, 13 August 2015 (UTC)Reply[reply]

The section about moving out of Virtual Machine is bogus and should be rewritten

All the methods that consist of copying files to Windows won't work because to properly copy the files of an (Arch)Linux installation, we need to preserve all the files attributes and that is only possible with a really compatible Posix file system. What is possible is to create a big tar file inside the Virtual Machine and to move around the tar file (including in Windows) because it contains all the metadatas.

--Olive (talk) 18:16, 6 July 2016 (UTC)Reply[reply]

All the methods? Windows is mentioned only once on the page. Anyway, I've flagged the relevant part with Template:Accuracy. -- Lahwaacz (talk) 19:56, 6 July 2016 (UTC)Reply[reply]
In the section about moving out, they suggest to set up a shared folder. If you copy files to Windows from it, it wouldn't preserve the files attributes and cannot result on a reliable installation (moreover special file like block devices won't be preserved). If you setup a shared folder between two GNU/Linux systems (guest and host), it might work in theory but I doubt very much that shared folders preserve all the necessary file attributes. The shared folders method is fundamentally bogus. Ext2fsd is useless in this situation for the same reason. In summary, the section need to be rewritten. The section about moving inside a virtual machine is correct (although systematically, we should pass the -H option to rsync to preserve hard links that rsync does not preserve by default).
One correct method to move out of a virtual machine would be to use a method similar to the one to move inside it. Convert the virtual disc to raw. Then boot the ArchLinux install disc (or another GNU/Linux boot disc), mount the image from there and copy all the files (with their attributes). --Olive (talk) 20:56, 6 July 2016 (UTC)Reply[reply]

Ext2FSD is (probably) deprecated

Checking the alternativeTo webpage on Ext2FSD, I have discovered that development on that program has been discontinued, with the last update coming in November 2017. I have formatted a couple of partitions on my HDD to use the Ext4 file system. Then I gave each of those partitions drive letters using Ext2FSD. However, when I tried to access the partitions using Windows 10's File Explorer, it prompted me to format them, using either NTFS or FAT32. Therefore, I cannot recommend using Ext2FSD to read or write to Ext4 partitions anymore.

YuGiOhFan2020 (talk) 20:39, 26 June 2020 (UTC)Reply[reply]