2014年1月16日 星期四

Unable to open kernel device "\\.\vmci": 重疊的I/O操作正在進行中



VMware Workstation 6.5
Unable to open kernel device "\\.\vmci": 重疊的I/O操作正在進行中。. Did you reboot after installing VMware Workstation?
Module DevicePowerOn power on failed.

解決方法一:
開啟VM對應的.vmx檔進行修改。
vmci0.present = "TRUE" TRUE改為FALSE或者直接將這行刪除。
儲存後重新開機。

2014年1月15日 星期三

強制刪除目錄或檔案

有時會遇到檔案因為鎖定或其它原因不能刪除。
此時只要將以下指令存成.bat或.cmd的批次檔
再將檔案或目錄拖至批次檔,就可以刪除了。
DEL /F /A /Q \\?\%1
RD /S /Q \\?\%1
指令說明如下:
DEL 刪除檔案,命令參數: del /?
/F:表示強制刪除
/A:選擇檔案的屬性
/Q:安靜模式,不會跳出提示訊息就刪除
/S:連帶刪除子目錄下的檔案


RD 刪除目錄,命令參數: rd /?
/Q:安靜模式,不會跳出 提示訊息就刪除
/S:連帶刪除子目錄下的檔案


為避免不小心誤刪,以下是再次確認的批次檔範例
一樣存成.bat或.cmd批次檔,再將要強制刪除的目錄或檔案拖入即可。
 @echo off

echo.
echo.
echo **************************************
echo.
echo         強制刪除目錄和檔案:
echo.
echo **************************************
echo.
echo.
echo.

CHOICE /C YN /M "刪除請按 Y,否請按 N。"

if errorlevel 2 goto no
if errorlevel 1 goto yes

:yes
REM 強制刪除目錄和檔案
DEL /F /A /Q \\?\%1
RD /S /Q \\?\%1
exit

:no
exit

2014年1月6日 星期一

使用VNC 直接連線至ESXI GUEST VM

雖然使用vSphere Clinet也可以連線至主機下的guest vm,但有時連線效果會不好,以下就改用vnc直接連線。

一、先使用vsphere client連線至主機
二、點選指定的VM,\\Edit VM Settings\Options\Advanced\General\Configurations Parameters
三、新增三筆記錄如下
  remotedisplay.vnc.port="5900"
  remotedisplay.vnc.enabled="
true"
  remotedisplay.vnc.password="password"

四、使用vncviewer連線並指定為 主機ip:5900

如還連不上,則需修改esxi本身的防火牆規則。

一、點選\\Configuration\Security Profile\Firewall\Properties..
二、將gdbserver打勾啟用(此方法較簡單),要個別開啟port參考以下連結。

https://www.netiq.com/documentation/cloudmanager22/ncm22_reference/data/bxzaz5n.html#bxzbk6j

2013年12月10日 星期二

好用的備份指令 Robocopy

當來源和目地的檔案有新舊不同步的情況時
可以使用以下指令來做(vista後有內建,xp和windows 2003需安裝Windows Server 2003 Resource Kit Tools)

robocopy 來源目錄 目地目錄 /MIR /R:0 /W:0

/mir 鏡像目錄
/r:0 重試次數=0
/w:0 等待重試時間=0

其餘參數可用 robocopy /? 來做查詢

2013年12月9日 星期一

變更在 Windows 2003 R2 安裝來源路徑

修改來源路徑,我們只需修改一下登錄機碼值即可

1、\\開始\執行 → regedit

2、[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Setup]
修改[SourcePath]的值為來源安裝目錄

3、[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion]
修改[SourcePath]的值為來源安裝目錄

2013年11月18日 星期一

開放網域伺服器匿名讀取權限

預設情況下伺服器的Guest帳號是停用的,此時連線至網芳上的共用資料夾,會出現要求輸入帳號密碼。但如果需要開放共用資料夾讓未加入網域的電腦讀取,就需要使用以下方式設定。

一、於共用資料夾的共用→使用權限,加入 "Everyone"  帳號,設定(完全或讀取)
二、於共用資料夾的安全性設定加入 "Everyone"  帳號,並設定為讀取
三、啟用該電腦上的Guest帳號
如還是會出現要求帳號、密碼的視窗。請注意本機與伺服器帳號是否重覆且密碼不一樣。
例如本機使用Administrator登入、伺服器Administrator也啟用但兩者密碼不一樣,
如有此情況,使用無重覆帳號登入即可。

2013年11月16日 星期六

非網域環境,遠端管理Hyper-V 2012 R2主機

當在非網域環境,遠端管理Hyper-V 2012 R2主機時,可能會出現

Hyper-V 管理員發生 "您沒有完成此工作的必要使用權限" 錯誤

 可經由以下方式解決

一、手機設定主機IP解析
修改C:\Windows\System32\drivers\etc\hosts
加入 IP 主機名稱
例如:192.168.1.11 HV1

二、使用hvermote工具,下載網址:http://code.msdn.microsoft.com/HVRemote/Release/ProjectReleases.aspx?ReleaseId=1827
1.以系統管理員身份開啟"命令提示字元"
2.執行:cscript //h:cscript
3.參考以下環境執行對應的指令
 
Configuration Where Purpose Commands
Client and Server both workgroup Server Create a local account (eg "john") Use net user /? or Computer Management 
  Server Grant the user access hvremote /add:accountname          ***
  Client Allow Anonymous Logon remote DCOM access hvremote /anondcom:grant
  Client Logon with matching local account.  
  Client If passwords do not match cmdkey /add:servername /user:servername\account /pass
  Both   Verify configuration for errors hvremote /show /target:othercomputername
-------------------------      
Client workgroup, Server domain Server Grant domain account access hvremote /add:domain\account           ***
  Client Allow Anonymous Logon remote DCOM access hvremote /anondcom:grant
  Client Set credentials for domain account cmdkey /add:servername /user:domain\account /pass
  Both   Verify configuration for errors hvremote /show /target:othercomputername
-------------------------      
Client domain, Server workgroup Server Create a local account (eg "john") Use net user /? or Computer Management 
  Server Grant the user access hvremote /add:accountname           ***
  Client Allow Anonymous Logon remote DCOM access hvremote /anondcom:grant
  Client Set credentials for local account cmdkey /add:servername /user:servername\accountname /pass
  Both   Verify configuration for errors hvremote /show /target:othercomputername
-------------------------      
Client and Server both domain Server Grant the non-admin user access hvremote /add:domain\account           *** 
  Both   Verify configuration for errors hvremote /show /target:othercomputername

此時再使用Hyper-V管理員,應該就可以正確連上伺服器了。

參考來源:
http://www.askasu.idv.tw/index.php/2008/12/25/142/
http://blog.tenyi.com/2013/04/hyper-v-server-2012.html