顯示具有 virtualbox 標籤的文章。 顯示所有文章
顯示具有 virtualbox 標籤的文章。 顯示所有文章

2022年7月10日 星期日

pfsense PPPOE 無法撥號問題

最近升級網路,因為設定一直有問題,研究了一下之前有問題的pfsense PPPOE設定。之前的狀況是,PPPOE沒辦法撥號,但是卻可以取得小烏龜的LAN IP address。並且之前PPPOE撥號偶然能夠連上的狀況,電腦的performance也會變得不穩定。本來以為是VM的效能問題,所以之前就改成使用另一台router撥號再設定DMZ(這次遇到的問題是連小烏龜區域網路IP都沒辦法取得)。結果這次下去研究各個設定之後發現原來是我的virtualbox設定有問題。

之前我的virtualbox網路設定裡的混合模式一直是設成全部允許,但是這次發現應該要設成拒絕

設置混合模式規則( promiscuous mode policy)可以在用戶界面的網絡設置中配置,也可以用命令行工具VBoxManage配置,詳見:Section 8.8, “VBoxManage modifyvm”

混雜模式規則是:

a)deny(默認設置),它可以隱藏不適合該虛擬機的網絡適配器的流量。

b)allow-vms,它可以隱藏在這個虛擬機的網絡適配器中的所有主機的流量,但允許它對來自其它虛擬機或發送到其他虛擬機的流量可見。

c)allow-all 刪除所有限制——虛擬機的網絡適配器能看到的所有通信流量。

 改完設定後PPPOE回復正常並且performance也回復到正常水準,以我的狀況從需要使用4 core變成只要1 core。

參考資料:

https://www.itread01.com/articles/1476261008.html

2019年10月27日 星期日

Virtualbox 移動vdi以及snapshot問題

這幾天遇到一個問題是當想要移動virtualbox系統的vdi以及snapshot時,snapshot與vdi分離後parent UUID出錯。問題是出在存放裝置應該要選擇snapshot的vdi而不是原始的vdi檔案。如果不幸已經出錯可以照下面的命令修復snapshot vdi的parent UUID。視情況也會需要修復.vbox檔案

The parent UUID (00000000-0000-0000-0000-000000000000) isn’t set correctly. Set it to its parent disk:

CODE: SELECT ALL   EXPAND VIEW
D:\>VBoxManage.exe internalcommands sethdparentuuid "c:\Users\UserName\VirtualBox VMs\VMName\Snapshots\{fdb2b61d-2212-45cc-8d29-b9f598d06f39}.vhd" {b76d8026-e222-470a-9c83-bc91351bb307}
UUID changed to: b76d8026-e222-470a-9c83-bc91351bb307


參考資料
parent UUID
https://forums.virtualbox.org/viewtopic.php?f=6&t=79896
merge snapshot
https://superuser.com/questions/590968/quickest-way-to-merge-snapshots-in-virtualbox

2019年7月24日 星期三

Ubuntu virtualbox guest OS 使用雙螢幕

發現在virtualbox下的guest OS也可以使用雙螢幕,需要安裝guest additions extension。首先在virtualbox設定-視訊-螢幕數量更改至需要的螢幕數量,重啟guest os之後很重要的是要關閉自動調整客體大小,之後才能在檢視-虛擬畫面裡面啟用,啟用之後就可以正常使用雙螢幕了,也可以再開啟自動調整客體大小。

參考資料
自己
https://forums.virtualbox.org/viewtopic.php?f=8&t=79211
https://superuser.com/questions/109485/virtualbox-to-use-dual-monitors

2018年11月3日 星期六

virtualbox pfsense 網路回不來問題

之前一直有碰到電腦休眠後回復網路回不來的問題,奇怪的是電腦本身可以但是外接的網卡LAN網路卻不通,後來想了一下發現應該是virtualbox自己bridge了所以本機可以但是因為virtualbox在執行中外接網卡卻中斷所以卡住(lock),解決方法是將virtualbox整個關閉後再重新執行就可以解決問題。

參考資料
自己

2016年12月21日 星期三

virtualbox guest windows OS network issue

遇到一個問題是guest OS windows會不定期網路沒有網際網路,後來發現host有裝vmplayer,將vmware network adapter停用後目前問題解除,待觀察

經過一陣子觀察之後沒有再出現異常,應該是這個問題沒錯,有遇到相同問題的人可以一試

20170201更新
還是有問題發生,暫停guest os再取消暫停之後可以回復網路狀態

參考資料
自己

2016年4月19日 星期二

Windows 10 磁碟空間 storage space經驗分享

最近想組raid保護資料,研究了一下發現硬體raid可能有風險,如果controller壞掉的話必須要找到相同晶片資料才可以救援,而且同樣容量的硬碟外接硬碟比裸碟便宜不少。所以後來看了資料後決定使用windows自身的軟體raid機制。

先是發現windows7不支援外接硬碟布建軟體raid,本來看到有人說可以更改分割表的bit把硬碟顯示為fix,後來看了一下發現是發文者弄錯了。後來看到windows8以上可以使用新功能-磁碟空間(storage space)可以使用外接硬碟,就決定將系統升級到windows10。

本來想要架raid5,買了兩顆3TB的硬碟加上原有的一顆三組,後來接上去之後發現windows磁碟空間的架構與硬體不同,不需用到整顆硬碟容量做設定可以切割。於是先分割小空間做測試,傳輸檔案時發現速度非常慢,usb 3.0速度僅有10MB/s,實在是不可思議,本來想說沒救了,後來看到有人分享加速的方法,原來是windows考量到power failure的可能將寫入快取取消限制效能。

開啟加速方法如下:

  1. 使用系統管理員權限開啟powershell
  2. 輸入Get-StoragePool,找到FriendlyName
  3. 輸入Set-StoragePool -FriendlyName <Storage Pool Name> -IsPowerProtected $True
開啟加速之後速度可以達到50MB/s,不過還是達不到usb 3.0的速度,後來查了資料知道同位(raid5)寫入速度比較慢,最後改成mirror(raid1)後問題解決。

最後是virtualbox在升級到windows10後發生網卡找不到問題,同樣搜尋後找到必須解除安裝後重新安裝virtualbox問題解決。

參考資料
storage space加速
https://social.technet.microsoft.com/Forums/windowsserver/en-US/64aff15f-2e34-40c6-a873-2e0da5a355d2/parity-storage-space-so-slow-that-its-unusable?forum=winserver8gen
同位(raid5)寫入速度慢
http://blogs.technet.com/b/mspfe/archive/2013/02/25/why-windows-server-2012-parity-storage-spaces-might-perform-slowly.aspx
virtualbox找不到網卡問題
http://ftcforum.usfirst.org/showthread.php?4898-Error-relaunching-the-VirtualBox

2015年10月5日 星期一

Apache 使用virtualbox分享資料夾做為www資料夾內容 gitweb設定


1) Power the VM down and add the shared folder with the Virtualbox Manager (never works right for me if VM is on)

2) Power on the VM and make your symbolic link to the shared folder where ever you want your web root to be:
ln -s /media/sf_share /var/www
chown -h www-data /var/www
NOTE: If your OS runs apache under the user: apache or apache2, replace www-data with that.

3) Add the user apache runs under to the group vboxsrv. Edit /etc/group and on the line that defines the vboxsrv group. Here is what my line in the group file looks like:
vboxsf:x:1001:sean,www-data
NOTE: Again, swap out www-data for the user apache runs under, if not www-data.

4) Reboot the VM.

重點是在建立soft link到www資料夾下 step 2

https://forums.virtualbox.org/viewtopic.php?f=3&t=34922

檢查link是否建立成功
http://linux.vbird.org/linux_basic/0230filesystem.php#ln

apache tool
htdigest -c 建立密碼檔
mod-avaliable and mod-enabled
使用symbolic link把avaliable link到enable下,apache啟動時會讀取enable下之所有module
gitweb需要load module如下
alias.conf
alias.load
auth_basic.load
auth_digest.load
authn_file.load
authz_default.load
authz_groupfile.load
authz_host.load
authz_user.load
autoindex.conf
autoindex.load
cgi.load
dav_fs.conf
dav_fs.load
dav.load
deflate.conf
deflate.load
dir.conf
dir.load
env.load
mime.conf
mime.load
negotiation.conf
negotiation.load
php5.conf
php5.load
reqtimeout.conf
reqtimeout.load
setenvif.conf
setenvif.load
status.conf
status.load


gitolite client設定
git clone git@<ip>:<repository name>.git

以下需在repository目錄下
看狀態 git status
commit 差異文件 git commit -a
上傳 git push <remote name, default origin> <branch name/master>
加入檔案 git add <file1> <file2> ...

git remote add [<options>] <name> <url>

參考資料
同事

2015年2月3日 星期二

virtualbox vdi verr_not_supported

前幾天VM突然打不開,現象是媒體管理員顯示黃色驚嘆號,重新掛載也無法,錯誤訊息verr_not_supported,進階訊息是VBOX_E_IPRT_ERROR。本來查到是vdi內容版本與virtualbox不符,可是前一天還可用怎麼會突然就不行,後來找到vboxmanage command "VBoxManage internalcommands repairhd --format VHD --filename <image>"試著修復vdi結果居然顯示invalid header,只好再繼續找解法。既然是header出錯就想到應該是整個vdi檔損毀,但使用chkdsk修復硬碟卻也顯示硬碟沒問題,本來覺得大概無解了,沒想到找到一篇說把0000到01D0用正常的vdi檔頭覆蓋就可以,死馬當活馬醫之下還真的解決了!寫在這邊供參考。

使用的軟體是 HxD Hex Editor

參考資料
https://forums.virtualbox.org/viewtopic.php?p=29267#p29267
https://forums.virtualbox.org/viewtopic.php?f=6&t=46711
https://forums.virtualbox.org/viewtopic.php?f=6&t=44654#p201104
vboxmanage command
https://www.virtualbox.org/ticket/10785

virtualbox 增加硬碟空間

因為原來的ubuntu硬碟空間設定太小,導致現在空間滿了,需要增加硬碟空間。search了一下發現我設的固定硬碟大小無法增加空間,不過後來發現那是中文網頁的資訊,事實上是可以轉換的。

先在virtualbox安裝目錄下使用
vboxmanage.exe clonehd \要調整的硬碟路徑.vdi \複製到的路徑.vdi

複製完後新硬碟vdi就會從固定大小轉換為動態大小,就可以使用指令改變大小

vboxmanage.exe modifyhd \要調整的硬碟路徑.vdi --resize 51200

這邊的51200指的是MB

我試了參考資料2&3。發現磁區無法延伸,後來發現是要將sda2刪除(sda5是在sda2下面,也就是sda1與未配置區中間不可有別的磁區阻隔),刪除之後就可以延伸。供參考。

參考資料
http://superuser.com/questions/716649/how-to-change-fixed-size-vdi-with-modifyhd-command-in-windows
http://www.arthurtoday.com/2013/04/virtualbox-resize-partitions-of-ubuntu-guest-part1.html
http://www.arthurtoday.com/2013/04/virtualbox-resize-partitions-of-ubuntu-guest-part2.html

2014年7月22日 星期二

Virtualbox 共用資料夾無法symbolic link問題

在寫case的時候遇到無法建symbolic link的問題,顯示唯讀的檔案系統。搜尋了一下發現是virtualbox在win7上的問題,跟管理員權限與virtualbox要打開設訂有關。

Fixing your virtualbox shared folder symlink error

Operations such as installing node.js or python virtualenv to a virtualbox writable shared folder can fail if you try to do this as a linux (ubuntu) virtualbox guest running Windows 7 host.
The cause is symlink permission.
Typical error:
ln -fs out/Release/node node
ln: failed to create symbolic link `node': Read-only file system
It can also be a “Protocol error”.
This happens even if your shared folder is writable.

Fix: Enable symlinks feature in VirtualBox

Run at cmd prompt:
  1.     
  2. VBoxManage setextradata YOURVMNAME VBoxInternal2/SharedFoldersEnableSymlinksCreate/YOURSHAREFOLDERNAME 1  
  3.     
Verify by running:
  1.     
  2. VBoxManage getextradata YOURVMNAME enumerate  
  3.     
If your user belongs to Administrators group then start VirtualBox with “Run as Administrator”!

上面的參數請視情況修改:
  • c:\Oracle\VirtualBox\ : 這是VirtualBox的預設資料夾,如果安裝在不同資料夾,請自行修改。
  • YOURVMNAME : 請修改為你要開啟的VM名稱。
  • YOURSHAREFOLDERNAME :修改為VM設定中共用資料夾的名稱

參考資料
http://www.plumeqi.com/post/VirtualBox-shared-folder-symlin-error.html
http://ahtik.com/blog/2012/08/16/fixing-your-virtualbox-shared-folder-symlink-error/
http://gwokae.mewggle.com/wordpress/index.php/archives/1097

2014年1月13日 星期一

ubuntu virtualbox 共用資料夾 plexWatch, splashtop streamer, xrdp on ubuntu 13.10

接續上篇使用ubuntu設定plexwatch web時也遇到一些問題,整理如下。

  • virtualbox共用資料夾位置在/media
    • 需要先將使用者加入群組
    • virtualbox預設為vboxsf
    • 終端機輸入指令sudo gpasswd -a 使用者帳號 vboxsf
  • 在設定crontab工作時不要輸入使用者名稱
  • twitter則需填入consumer_key, consumer_secret, access_token, access_token_secret四項,並且create my access token
  • ubuntu軟體中心位置 /usr/bin/software-center
  • remotebox不知為何無法成功使用,使用phpvirtualbox取代
  • virtualbox如果要使用遠端控制(非windows內建的遠端桌面)則需安裝extension pack
  • xrdp如果遇到灰色畫面無法進入則輸入以下指令,原因是gnome更動了設定
    • sudo apt-get install xrdp
    • sudo add-apt-repository ppa:xubuntu-dev/xfce-4.10
    • sudo apt-get update
    • sudo apt-get install xfce4
    • echo xfce4-session >~/.xsession  
  • ubuntu上使用splashtop streamer需要輸入以下指令否則目前無法使用於13.10(官方尚未支援)
    • sudo apt-get install aptitude
      sudo aptitude update
      sudo aptitude safe-upgrade
    • python /opt/splashtop-streamer/SRStreamer.pyc
    • sudo aptitude install python-appindicator

參考資料
共用資料夾權限
http://ubuntuforums.org/showthread.php?t=1921707
http://www.mobile01.com/topicdetail.php?f=300&t=3122670
plexWatch on ubuntu
http://www.cyberciti.biz/faq/how-do-i-add-jobs-to-cron-under-linux-or-unix-oses/
https://github.com/ljunkie/plexWatch/blob/master/README.md
crontab
sudo gedit /etc/cron.d/anacron
http://askubuntu.com/questions/2368/how-do-i-set-up-a-cron-job
xrdp 灰畫面
http://c-nergy.be/blog/?p=4448
http://askubuntu.com/questions/266271/xubuntu-12-04-desktop-grey-with-no-icons
plexWatch email notification
https://forums.plex.tv/index.php/topic/72552-plexwatch-plex-notify-script-send-push-alerts-on-new-sessions-and-stopped/
ubuntu splashtop streamer on 13.10
https://support-splashtoppersonal.splashtop.com/entries/30097576-Splashtop-Streamer-on-Ubuntu-13-10
http://qiita.com/nyarla/items/4202ddb8e29e2d0ddd65
http://timothyandrewbarber.blogspot.tw/2011/02/finding-config-folder-in-ubuntu.html
RemoteBox
http://knobgoblin.org.uk/downloads.cgi
http://www.openfoundry.org/tw/foss-programs/8319--virtualbox-remotebox
http://www.ibm.com/developerworks/cn/linux/l-cn-remotebox/
http://www.openfoundry.org/tw/foss-programs/8319--virtualbox-remotebox
phpvirtualbox
http://www.arthurtoday.com/2011/11/windows-phpvirtualbox.html#.Usl3t_QW2tQ
http://blog.segmentfault.com/jifei/1190000000346904
vboxwebsrv.exe
https://forums.virtualbox.org/viewtopic.php?f=6&t=38449
http://nikolas.demiridis.gr/post/10280216759/how-to-run-vboxwebsrv-as-a-service-on-windows-2008
virtualbox rdp extension pack
http://www.virtualbox.org/manual/ch07.html#vbox-auth
ubuntu切換2D
http://www.mobileai.tw/2013/01/08/ubuntu-12-10-2d/
PlexWatch ip address必須與PMS在同一台電腦上(localhost)才可正常抓取
https://forums.plex.tv/index.php/topic/72552-plexwatch-plex-notify-script-send-push-alerts-on-new-sessions-and-stopped/page-21#entry483408