Showing posts with label Virtualbox. Show all posts
Showing posts with label Virtualbox. Show all posts

2015-12-05

Virtualbox 與 Avira 的問題

2015/12/02 Virtual machine 突然無法開啟, 等很久之後, 出現以下訊息:

Timed out after 60014 ms waiting for child request #1 (ClosedEvents).
(rc=258)
where: supR3HardNtChildWaitFor what:5
Unknown status 258 (0x102) (258)

好在 2015/11/28 有使用 ghost 做備份. 回復之後, 第一次執行 VirtualBox VM 沒問題, 但過一陣子之後, 問題又回來了.
感覺好像是防毒軟體 (Avira) 出問題. 將其移除後, 果然就可以了. Virtualbox forum 有人也是有相同問題 : [Solved] E_FAIL (0x80004005)

Avira 用了很久, 一直存在一些小問題, 但習慣了, 就繼續使用到今.

但 2015/12/04 開始, 決定試用 Bitdefender.

2014-03-29

VirtualBox 與 Debian/Ubuntu 客端額外功能(Guest Additions)

來源 : 石頭閒語
本文的內容包括 :
  • 安裝客端額外功能(Guest Additions)
  • 滑鼠整合沒作用(Mouse pointer integration not work)
  • 螢幕解析度可調整項目變少了

必須要先安裝的套件

一、安裝 build-essential and module-assistant
安裝 build-essential ,這將用於編譯 VirtualBox 客端功能的 Linux 核心模組。
$ sudo apt-get install build-essential
$ sudo apt-get install module-assistant
$ sudo apt-get install linux-headers-$(uname -r)

 
二、安裝 dkms

若你的 Guest OS 是 Ubuntu 10.04 Lucid 或更新的散佈版本時,必須安裝 dkms。它是新的核心模組載入機制。已知 VirtualBox 的滑鼠整合功能模組依賴此機制載入。若未安裝 dkms ,則滑鼠整合功能不會發生作用。

$ sudo apt-get install dkms

如果你已經安裝了客端額外功能,才發現沒有安裝 dkms 且滑鼠整合功能沒作用,你必須安裝 dkms 之後,再重裝一次客端額外功能。更快捷的方式是在安裝 dkms 之後,直接執行指令 sudo /etc/init.d/vboxadd setup。裝好之後,須重新啟動 Guest OS.

三、下載 VirtualBox Guest Additions ISO

當你使用 VirtualBox 選單的「安裝 Guest Additions ...」之後,VirtualBox 通常會自動下載客端額外功能軟體的 CD ISO 影像檔,並且自動掛載。若你碰到未自動下載的情形時,也可自行到官方網站下載。下載後,再自行透過 CD 裝置掛載該 ISO 影像。掛載 VBoxGuestAdditions CD ISO檔後,開啟它,並以 root 的權限執行其中的 VBoxLinuxAdditions.run。

I tried to install the VirtualBox Guest Additions on a virtual Debian machine. However when I tried executing the installer script I got this error:

bash: ./VBoxLinuxAdditions.run: Permission denied
The script uses /bin/sh as shell and on Debian Wheezy /bin/sh is symlinked to /bin/dash. Dash is a more light-weight replacement for Bash, and it turns out that the VirtualBox script does not work as it should when run with “dash”. An easy workaround is to explicitly run the script with “bash” with the following command:
sudo bash ./VBoxLinuxAdditions.run
or
sudo sh ./VboxLinuxAdditions.run

滑鼠整合沒作用(Mouse pointer integration not work)


Guest OS 為 Ubuntu 10.04 及之後的版本,請參考上一節第二項關於 dkms 的內容。

正常來說,新建的 Guest OS 在安裝「客端額外功能(Guest Additions)」並重新啟動 Guest OS 之後,「滑鼠整合」就會發揮功效。但若你碰到滑鼠整合功能沒有作用的詭異情形時,你需要編輯 /etc/X11/xorg.conf (*1*1. 若此文件不存在,則 Guest OS 應該是新版的,請參考上一節 dkms 的內容),手動加入下列的設定段落。

Section "InputDevice"
        Identifier      "vboxmouse"
        Driver          "vboxmouse"
        Option          "CorePointer"
        Option          "Device"        "/dev/input/mice"
EndSection


正常來說,就算 xorg.conf 沒有上述的 InputDevice 段落,滑鼠整合功能依然會作用。

我今天新裝了一個 Ubuntu 9.04 Desktop 的 guest 系統,安裝客端額外功能後,滑鼠整合功能竟然沒有發生作用。我覺得很奇怪,已經我先前安裝過數次 Ubuntu Desktop 作為 guest 系統,但都沒發生這問題。查詢後才知道,有時候要自己手動加入上述的設定內容。我開啟先前安裝的 Ubuntu Desktop guset ,把兩邊的 xorg.conf 比對一下,結果先前安裝的 Ubuntu Desktop guest 的 xorg.conf 沒有這一段,但滑鼠整合還是可作用。真是怪哉。

螢幕解析度可調整項目變少了


首先,如果是 Ubuntu 9.04 的使用者,可以參考我先前寫的使用筆記,按照裡面的步驟修正客端額外功能的安裝程式。 Ubuntu 9.10 的使用者,請參考 Logan 寫的Ubuntu 9.10 + VirtualBox Guest Additions修正。

當我安裝額外功能並重新啟動 guest 系統後的第一次晝面,我的螢幕解析度有 1280x768 (按預設 12MB 顯示記憶體)。我啟動 Ubuntu Desktop 的「顯示」控制台,一開始顯示我可以選擇從 1280x768 到 640x480 的5種解析度。接著我將螢幕解析度下調到 1024x768。調整完畢後,我很訝異地發現,在「顯示」控制台內,我可以選擇的解析度只剩下 1024x768 到 640x480 的3種解析度了。我沒有辦法再往上調整更高的解析度了。

如果你跟我一樣碰到這種情形,我們需要編輯 /etc/X11/xorg.conf ,手動在 Screen 段落中,加入 Display 的子段落,明確地列出我們希望能調整的解析度項目。如下所示:

Section "Screen"
   Identifier   "Default Screen"
   Monitor      "Configured Monitor"
   Device      "Configured Video Device"

   DefaultDepth    24
   SubSection      "Display"
      Depth           24
      Modes           "800x600" "1440x900" "1360x768" "1280x1024" "1280x960" "1152x864" "1024x768" 
   EndSubSection

EndSection

上例設定範例,列出7種解析度,那麼在「顯示」控制台中,就會至少出現這7種解析度供我們選擇。不再愈調愈少。

登入晝面(GDM)會取 Modes 中的第一個項目作為解析度。所以我把 800x600 放在第一個。

2013-12-20

Virtualbox host-only network error and solution

記錄檔名稱:         Microsoft-Windows-Dhcp-Client/Admin
來源:            Microsoft-Windows-Dhcp-Client
日期:            2013/12/20 上午 03:54:49
事件識別碼:         1001
工作類別:          位址設定狀態事件
等級:            錯誤
關鍵字:          
使用者:           LOCAL SERVICE
電腦:            Cliff-PC
描述:
DHCP 伺服器並未將網路位址指派給電腦在網路位址 0x08002700FCC0 的網路卡。發生下列的錯誤: 0x79。您的電腦將會繼續嘗試從網路位址 (DHCP) 伺服器取得一個位址。

由 Virtualbox host-only adaptor 所引發, 原因不明.

Solution : 手動設定 host-only network in Oracle VM virtualbox GUI

2013-12-20_045519

2013-12-20_045601

2012-09-05

How to Change UUID of VDI files

先做好一個Windows XP的vdi,再複製一份VDI要分別做Office 2000和Office 2003的VM,出現UUID重覆的訊息,要如何處理呢?

"c:\Program Files\Oracle\VirtualBox\VBoxManage.exe" internalcommands sethduuid 檔案名稱
That's it!

How to resize a VirtualBox disk partition

Method 1 :

VirtualBox is a cross platform full virtualizer for x86 hardware. It runs on Windows, Linux, Macintosh and OpenSolaris hosts and supports a large number of guest operating systems such as Windows, Linux and OpenBSD. In a previous guide I have shown you How to install Ubuntu Linux on Windows using VirtualBox . The procedure is the same if you want to install Windows on Linux. The guest operating system is installed on a virtual disk created by VirtualBox which is nothing more than a single .vdi file. When you first create the virtual machine you must set a certain size for this disk. However after playing with VirtualBox you might realize you need more space because your virtual disk is full So, in this tutorial I will explain how to enlarge an existing virtual disk or in other words how to resize your virtualbox vdi. I have a Windows XP installation running on Linux and specifically Archlinux and I am going to create a larger disk for Windows XP.
**Note: The same procedure works for Windows Vista also. The only difference is that you have to use your original Vista installation CD for Bootmgr repair the first time the system is started after the GPARTED steps have been followed. (Thanks to Andrew)

Run VirtualBox and go to File -> Disk Manager.

1sm
Here as you can see I have a .vdi disk with a size of 10GB (1) which is almost full. So press the New button (2) to create a new virtual disk.

2sm
Click next to go to the next page of the New Virtual Disk Wizard.

3
Select Dynamically expanding image as Image type and click next.

4
Select a name for the new image (1), this should be different than the existing one, and also set the size of the new disk (2). Here I've set it to 20GB.

5
Press Finish to end the wizard.

6
Now you should have 2 .vdi images in the Virtual Disk Manager. Click Ok to close the wizard.

7sm

Here we are gonna need GParted to copy the data of our old disk to the new one. GParted is the Gnome Partition Editor application for creating, destroying, resizing, moving, checking and copying partitions, and the file systems on them. It has a LiveCD which you must download from here . You don't have to burn it on a cd, just store the .iso somewhere in you hard disk.

Now select the existin Windows XP installation (1) and click on the Settings button (2).

8sm
In the General -> Advanced tab set CD/DVD Rom as the first boot device.

9sm
In the Hard Disks settings double click below your IDE Primary Master and set IDE Primary Slave and the new Virtual Hard Disk image.

10sm
In the CD/DVD-ROM settings click on Mount CD/DVD Drive (1), choose ISO Image File (2) and use the folder button to browse to the location you have saved the gparted live cd (3).

11sm
Now click the Ok button and start the Windows XP Virtual Machine. Press Enter to boot GParted Live with Default Settings.

12sm
Don't touch keymap should be fine. Again press Enter.

13sm
Select the Language you prefer. Press Enter for English. And again press Enter for the default video card settings.

14sm
GParted will automatically scan your virtual disks. /dev/hda should be the old one and /dev/hdb the new one. Right click on your first disk and select Copy.

15sm
Next select /dev/hdb from the drop down menu (1), right click on the unallocated space and select Paste (2).

16sm
Drag the right edge (1) like you see in the screenshot so as not to leave any unallocated space in the new disk. Next click the Paste button.

17sm
Now press Apply to apply the changes.

18sm
When all listed operations are applied click the Close button. Again right click on the new partition /dev/hdb and click Manage flags. Here you should tick the boot flag.

19sm

Gparted will scan all devices once more. When it's done close the program and shutdown the live cd from the exit button. It will prompt you to press Enter. Now return to the VirtualBox application, select the Windows XP virtual machine and click the settings button. In the General -> Advanced tab select Hard Disk as the first boot device.

20sm
In the Hard Disk settings use the delete button (1) to remove the IDE Primary Slave, leave just IDE Primary Master (2), and select the new .vdi (3).

21sm
In the CD/DVD-ROM settings tick the Host CD/DVD Drive.

22sm
Press the Ok button and start your Windows XP virtual machine. Windows might ask to check their filesystem. Just let them do it.

23sm
After they automatically reboot you will log into your new resized virtualbox disk without having lost any of your data. You can now just delete the old .vdi. Enjoy!

24sm

Method 2 :

Use Norton ghost bootable CD. See 賴榮樞的軟體資訊誌 直接擴充現有的VMWare虛擬磁碟容量