• Successfully I migrated a x86_64 Linux OS from a PC to a virtual machine which can be run on ARM64 M1 MacBook Pro


    I did it.

    Words in short,

    I turned the x86_64 Linux OS of my laptop into a file and it can be run as a virtual machine on the ARM64 M1 Macbook Pro.

    In plain words,

    I turned my laptop into a file which can be run on any computer!

    ----

    With some help of my research and many tries, it works.

    Here are some articles I wrote:

    Planing on converting physical disk to a VMware image, then convert to qemu(kvm) image for booting on M1 mac

    And

     

    ----

    I did these work and I get a file called "universe.qcow2" converted from "universe.vmdk" which was derived from VMware ESXi.

    This file can be run as a virtual machine in qemu.

    I downloaded a Qemu manager which runs on M1 Macbook Pro, it is called "UTM". It comes with ARM64 qemu binaries which is neat for my project.

    1. create a virtual machine , say simple x86_64 linux virtual machine (use mouse click)

    2. create a virtual disk. For example it will be saved as "linux.qcow2" (use mouse click)

    3. replace the "linux.qcow2" file with a simple readable link pointed to the "universe.qcow2" which was located in my 8T drive.

    (commands in terminal)

    # for UTM's version higher than 2.0.20
    # the virtual machine's name is called "Virtual Machine" in my case
    cd ~/Library/Containers/com.utmapp.UTM/Data/Documents/Virtual Machine.utm/Images
    
    # remove the unused images
    rm linux.qcow2
    
    # create a readable link pointed the file (lie to the MacOS), save more space for Mac
    ln -sf /Volume/disk8t/vmware_exported/universe/universe.qcow2 linux.qcow2
    
    # then, start the Virtual Machine in UTM and it should work!

    If the graphics is too laggy. Try virtio-vga in the UTM settings, it's less laggy.

    My qemu arguments

    qemu-system-x86_64 -L /Applications/UTM.app/Contents/Resources/qemu -S -qmp tcp:127.0.0.1:4444,server,nowait -vga none -spice port=5930,addr=127.0.0.1,disable-ticketing,image-compression=off,playback-compression=off,streaming-video=off -device virtio-vga -smp cpus=1,sockets=1,cores=1,threads=1 -machine q35, -accel tcg,tb-size=128 -global PIIX4_PM.disable_s3=1 -global ICH9-LPC.disable_s3=1 -boot order=d -m 512 -device AC97 -name "Virtual Machine" -device usb-ehci -device usb-tablet -device usb-mouse -device usb-kbd -drive "if=ide,media=disk,id=drive0,file=/Users/alex/Library/Containers/com.utmapp.UTM/Data/Documents/Virtual Machine.utm/Images/linux.qcow2,cache=writethrough" -device e1000,netdev=net0 -netdev user,id=net0 -device virtio-serial -device virtserialport,chardev=vdagent,name=com.redhat.spice.0 -chardev spicevmc,id=vdagent,debug=0,name=vdagent -uuid 20629A90-85C7-4762-A159-B06592159F24 -rtc base=localtime

     

    My settings

    OS: Linux

    Architecture: x86_64

    Destro: Ubuntu 18.04

    Display Manager: SDDM

    Desktop Environment: XFCE4 and KDE

    Boot Partition: /boot on /dev/sda1

    Swap Partition: on /dev/sda2

    System Partition: / on /dev/sda3

    Disk Space: 256GB

    ----

    Alert

    Some unknown reasons may make your virtual machine in Qemu FAIL.

    Don't use this in production mode. It might work. But hard drive may fail with some reasons...

    If you want to fix this hard drive failure in qemu, please read this : https://serverfault.com/a/854267

  • 相关阅读:
    【公告】对乐逍遥和王者之剑利用破解程序插入刷流量广告处理结果
    Thunder7.2.13.3884 JayXon
    免费获取半年 Bitdefender Total Security 2014
    WIN8.1 PRO RTM VOL.2013.09.18
    免费一年MAP2014+6个月免费MIS2014
    大蜘蛛9.0正式版
    腾讯控股涉足商业银行 微信或成先头兵
    植物大战僵尸2:奇妙时空之旅[官方安卓简体中文高清版]有内含....
    苹果iPhone 5C和5S发布后,消费者如何选择?
    pandas中DataFrame操作(一)
  • 原文地址:https://www.cnblogs.com/spaceship9/p/14503152.html
Copyright © 2020-2023  润新知