markdown如何创建将在linux上运行的osxelcapitanvm(代码片段)

author author     2022-12-14     368

关键词:

# How to create an OS X El Capitan VM that will run on Linux

VirtualBox only officially supports OS X guests on an OS X host, but it is possible to create one on an OS X host and transfer it over to a Linux host.  This tutorial will go over one possible way to accomplish this task.

## What you will need

* An Apple computer running OS X 10.11
* A Linux computer to transfer the VM over to
* 20 GB free on the Apple Machine
* 40 GB free on the Linux Machine

## Step One: VMWare

Install VMWare Fusion Pro on your OSX Host ( https://www.vmware.com/products/fusion/fusion-evaluation ).  Open it up and select File -> New.  

On the "Select the Installation Method" menu, choose "Install OSX from the recovery partition".  Follow the instructions and soon OSX will start installing in a VMWare VM.  Go through the OSX installation process until the point where OSX asks you to setup the installation (IE: create users, etc).  This could take up to two hours.  When its done, shutdown the VMWare VM.

In the VMWare "Virtual Machine Library" menu, select the OSX VM you just created, and then select File -> Export To OVF.

This will create a folder with three files in it:
* .mf
* .ovf
* .vmdk

## Step Two: Modify the OVF Files

Next we need to take care of a few inconsistencies between VMWare's OVF format and VirtualBox's OVF format.  Run the following commands on the .ovf file:

```
sed -i -e "s/vmware.sata.ahci/AHCI/g" <VM_NAME>.ovf
sed -i -e "s/ElementName/Caption/g" <VM_NAME>.ovf
```

Since we have modified the OVF file, its SHA1 checksum will have changed.  We need to update the .mf file to account for these changes.  The .mf file should look something like this:

```
SHA1(<VM_NAME>.ovf)= 640e7ddd6b5c69a9f9602e3664daaa92139b3214
SHA1(<VM_NAME>.vmdk)= 102282359761b742dddcf99405ad5b6989c1e467
```

Run:
```
shasum <VM_NAME>.ovf
```

Take the resulting hash and replace the hash after `SHA1(<VM_NAME>.ovf)= ` in <VM_NAME>.mf with this result.

Copy the OVF folder with all three files over to the Linux Machine.

## Step Three: Import OVF into Linux host VirtualBox

Open up virtualbox on the Linux host, and import the OVF.  You'll need to set the VM OS Type to "Mac OS X" and the OS Version to "Mac OS X 10.11 El-capitan (64-bit)".  

Next, open up a terminal and run the following `VBoxManage` commands:

```
VBoxManage modifyvm "$VM_NAME" --cpuidset 00000001 000306a9 04100800 7fbae3ff bfebfbff
VBoxManage modifyvm "$VM_NAME" --keyboard usb
VBoxManage setextradata "$VM_NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "MacBookPro11,3"
VBoxManage setextradata "$VM_NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
VBoxManage setextradata "$VM_NAME" "VBoxInternal/Devices/efi/0/Config/DmiBoardProduct" "Iloveapple"
VBoxManage setextradata "$VM_NAME" "VBoxInternal/Devices/smc/0/Config/DeviceKey" "ourhardworkbythesewordsguardedpleasedontsteal(c)AppleComputerInc"
VBoxManage setextradata "$VM_NAME" "VBoxInternal/Devices/smc/0/Config/GetKeyFromRealSMC" 1
```

Now you should be able to boot up the VM and have it run properly on the Linux host.  

如何在 Ruby 中获取 OS 和 OS ARCH 信息?

】如何在Ruby中获取OS和OSARCH信息?【英文标题】:HowcanIgetOSandOSARCHinformationinRuby?【发布时间】:2015-12-1406:33:52【问题描述】:在Ruby脚本中,我想获取操作系统信息,不仅是Linux,还包括32位或64位。那是因为我的程序将在多个Linux... 查看详情

如何在 google colab 中启用拼写检查器(colab 在 linux OS 上运行)?

】如何在googlecolab中启用拼写检查器(colab在linuxOS上运行)?【英文标题】:HowcanIenablespellcheckeringooglecolab(colaboperatesonlinuxOS)?【发布时间】:2020-07-2707:43:36【问题描述】:我们能否以任何方式为googlecolab中的降价单元启用拼写检... 查看详情

linux (g++) 上的分段错误,但 Mac OS 上没有。?

...试图保持它的结构,但我对C++编程仍然很陌生。我在OSX上创建了一个C++算法,它运行良好。然而,我需要在Linux上运行这个程序。在Linux上编译没有错误,但是当我运行程序时,它给出 查看详情

创建将在事件上运行函数的自定义指令

】创建将在事件上运行函数的自定义指令【英文标题】:Createcustomdirectivethatwillrunafunctiononanevent【发布时间】:2018-09-2822:59:33【问题描述】:在angularjs中我有一个指令:exportdefaultangular.module(\'cd.enter\',[]).directive(\'cdEnter\',()=>retur... 查看详情

如何创建一个将在 Windows 内核级别运行的进程?

】如何创建一个将在Windows内核级别运行的进程?【英文标题】:howtocreateaprocesswhichwillruninkernellevelinwindows?【发布时间】:2011-02-0713:18:12【问题描述】:我想创建一个kernellevelofprocessforwindows(Ring0),但我不知道从哪里开始。我想知... 查看详情

C++ 类文件未在 Linux OS 上运行的 Eclipse Mars 中构建二进制文件

...时遇到可怕的“找不到二进制文件”错误。这只发生在我创建了一个包含类代码的源文件时。当我编写不包含类的程序时,不会发生这种情况。例如,当我 查看详情

为啥 awk 脚本不能在 Mac OS 上运行,但在 Linux 上运行?

】为啥awk脚本不能在MacOS上运行,但在Linux上运行?【英文标题】:WhyawkscriptdoesnotworkonMacOSbutworksonLinux?为什么awk脚本不能在MacOS上运行,但在Linux上运行?【发布时间】:2014-08-1113:06:52【问题描述】:我有这个awk脚本,用于过滤差... 查看详情

如何使用输入变量来指定 GitHub 操作将在哪个自托管运行器上运行?

】如何使用输入变量来指定GitHub操作将在哪个自托管运行器上运行?【英文标题】:Howdoyouuseaninputvariabletospecifywhichself-hostedrunneraGitHubactionwouldrunon?【发布时间】:2021-10-1409:01:41【问题描述】:我正在使用GitHubActions。我正在尝试... 查看详情

Linux 中的 Segfault,在 Mac OS 上运行良好

】Linux中的Segfault,在MacOS上运行良好【英文标题】:SegfaultinLinux,worksfineonMacOS【发布时间】:2015-09-2903:58:13【问题描述】:我正在做一个C++家庭作业,我们必须在其中构建一个单链表哈希表。我已经在Mac上编写了我的代码-它可以... 查看详情

markdown如何在github上创建自己的maven存储库(代码片段)

查看详情

在 MAC OS X 上创建桌面快捷方式(如 .desktop 在 linux 中)

...desktopinlinux)【发布时间】:2014-09-0511:50:55【问题描述】:如何仅使用C++在MACOSX中创建桌面快捷方式。在linux中我可以使用.desktop文件来完成[DesktopEntry]Version=1.0Name=EclipseExec=/usr 查看详情

如何在markdown快速创建表格

参考技术A之前在写一篇文章的时候,希望在Markdown上创建一个表格,一开始就是ctrl+c,然后ctrl+v粘贴到Markdown,发现它并不像从网页复制表格粘贴到word文档上,能够将表格和文字都粘贴到word上,而仅仅是将文字复制上去。因为习... 查看详情

如何使用在所有平台上运行的 SWT 创建可执行 JAR?

】如何使用在所有平台上运行的SWT创建可执行JAR?【英文标题】:HowcanIcreatingexecutableJARwithSWTthatrunsonallplatforms?【发布时间】:2011-01-0311:30:30【问题描述】:SWT附带一个基本JAR和每个平台(Windows、Linux/32位、Linux/64位、Mac、AIX等)... 查看详情

如何将在 Docker 容器中运行的 Grafana 连接到在主机上运行的 Prometheus 数据源(在 Docker for Mac 上)?

】如何将在Docker容器中运行的Grafana连接到在主机上运行的Prometheus数据源(在DockerforMac上)?【英文标题】:HowtoconnectGrafanarunninginaDockercontainertoaPrometheusdatasourcerunningonthehostmachine(onDockerforMac)?【发布时间】:2020-03-0103:16:53【问题... 查看详情

从宏运行 OS 命令

...些参数并使用这些参数调用操作系统命令。我阅读了有关如何创建libreoffice宏以及如何在单元格中调用它的教程。我无法找到在宏中调用哪个函数来调用我的操作系统命令。有人知道怎么做吗?此命令是否类似于VBAEXCELf 查看详情

markdown如何在linux上安装tcpping(代码片段)

查看详情

如何使用更小的 OS 磁盘创建 azure VM

】如何使用更小的OS磁盘创建azureVM【英文标题】:HowtocreateaazureVMwithsmallerOSdisk【发布时间】:2020-10-1010:35:37【问题描述】:所以我在azure上运行一个小型VM来处理个人资料,并希望最大限度地降低成本。磁盘成本是我每天支出的... 查看详情

从 OS X 迁移到 linux Red-Hat 时出错

...。它在Mac上运行没有任何问题。有人告诉我,我们的项目将在Linux机器上编译,所以我想在提交之前确保它在Linux上工作。当我尝试在Linux上编译时,它给了我一些参考错误:/tmp/cckwoehj.o:Inf 查看详情