原文网址:http://www.sandyscott.net/2013/08/14/virtualbox-direct-drive-access/

I’ve trying to get my Raspberry Pi working with a touchscreen (eGalax Touch).

This blog post has been an incredible help, but I stumbled at the very last hurdle – modifying the contents of the SD card.

You see, my compile system (Ubuntu 13.04) was in a virtual machine (VM) – VirtualBox running on Windows 7.

Windows 7 doesn’t know how to read the various linux filesystems, so they’re invisible, which means I needed to access to the whole, raw disk directly from the VM.

Here’s a step-by-step guide to directly mounting raw SD card in your virtual machine, so you can edit it.

    1. Get the DeviceID for you SD Card reader

Open a command window as an administrator. (Press Start, type cmd, right click on cmd.exe in the list, and choose “Run as administrator”)

type

wmic diskdrive list brief

and if your system is anything like mine you’ll get something like this:

C:\Users\Sandy Scott>wmic diskdrive list brief
Caption DeviceID Model Partitions Size
WDC WD7500BPKT-75PK4T0 \\.\PHYSICALDRIVE0 WDC WD7500BPKT-75PK4T0 3 750153761280
O2Micro SD SCSI Disk Device \\.\PHYSICALDRIVE1 O2Micro SD SCSI Disk Device 1 3964584960

The top item is the main hard drive, the lower one is the SD card.

The bit we’re interested in is the DeviceID, in this case\\.\PHYSICALDRIVE1

    1. Navigate to the VirtualBox directory

Next thing you’ll need to find is the installation directory for VirtualBox. This is usually C:\Program Files\Oracle\VirtualBox\. You’ll know it’s the right one if it has lots of files starting with VBox in it.

Go there by entering this command

cd C:\Program Files\Oracle\VirtualBox
    1. Create the link file to the SD card
VBoxManage internalcommands createrawvmdk -filename "%USERPROFILE%/Desktop/sdcard.vmdk" -rawdisk "\\.\PHYSICALDRIVE1"

The file you’ve just created (sdcard.vmdk, on your Desktop) is a special link that lets a virtual machine access the SD card.

    1. Connect the VM to the SD card using the link

Now, open VirtualBox as administrator, and open the Settings for your virtual machine. Go to Storage -> Controller: SATA -> (right click) Add Hard Disk -> Choose Existing Disk and open the file you just created.

Fire up the VM and you should be able to access the SD card if all it’s glory!

最新文章

  1. http学习笔记(三)
  2. ireport开发报表,Java和JSP端如何集成
  3. 工作圈redis 使用
  4. 测试bug级别定义
  5. POJ 3468 A Simple Problem with Integers 线段树 区间更新
  6. mysqli 取出数据库中某表的表头和内容
  7. jquery第一期:运行第一个jquery
  8. 将图片文件以byte的形式从导数据库中
  9. mysql笔记一——安装和设置root密码
  10. iOS gcd 串行,并行,同步,异步代码研究
  11. 2017多校第9场 HDU 6169 Senior PanⅡ 数论,DP,爆搜
  12. PhpStorm 常用快捷键
  13. 多选框取值checkbox
  14. Python startswith() 函数 判断字符串开头
  15. nginx如何处理请求
  16. 【html】前端实现筛选条件跳转
  17. iOS 给UIView添加xib
  18. [转] Entity Framework 无法加载指定的元数据资源。
  19. 【c++基础】vector中按照Point类型某一个变量进行排序
  20. Struts 2 - Hello World Example

热门文章

  1. ubuntu下mysql的常用命令
  2. 解决从VIM复制出来的代码格式错乱或对齐的问题
  3. Linux设备驱动中断机制
  4. Java基础知识强化29:String类之String类构造方法
  5. Android进程机制
  6. 怎么在Linux上下载并安装ESET NOD32 Antivirus 4桌面版
  7. Asp.net 回车默认按钮
  8. C# Gma.QrCodeNet生成二维码
  9. Tomcat:Can't load IA 32-bit .dll on a AMD 64-bit platform问题的解决
  10. geotools导入shp文件到Oracle数据库时表名带下划线的问题解决