[VM] how to reduce hard disk for VM on ESXi
(VMDK)
Problem Description:
Recently, we encountered a problem that we need to shrink the hard disk for the VM on ESXi host. I
thought it was similar to the stand-alone version of vmware. We put out the disk shrink in guest os and then
reduce the size in vmware. But: it's not supported
The official way to shrink the hard disk for a VMware VM is to use the VMware vCenter Converter.
Shrinking
Virtual disk shrinking is supported when using VMware Converter converting source virtual
machine as a machine source (not as virtual to virtual).
Note: You cannot shrink virtual disks using vmkfstools in ESXi as the hypervisor is not aware of
the file system layout and cannot ensure a safe shrink operation.
For details, please refer to:
https://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1
002019
However, the actual operation of V2V is very slow, so we have to find the following "wild road", which is
effective in personal test. But say the important thing three times:
Backup, backup, backup!
Solution:
1. Log in to Guest OS and reduce the hard disk of Guest OS
Take Windows 2008 server as an example, it just has the function of compressing disks.
Select disk management, right-click Volume/Partition to shrink and select Shrink
The system will automatically scan the size that can be compressed:
Fill in the size you want to compress in the following dialog box:
Enter here:
19.5 (GB) x 1024 = 19968
After compression, the disk is as long as this:
2. Reduce the size of VMDK
Shut down the Virtual Machine, log in to the corresponding ESXi host and switch to the corresponding
datastore:
cd /vmfs/volumes/<datastore name>/<VM folder_name>
Here, you need to modify the description file *. vmdk, which is mainly the line below "extend description".
As it is:
# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=c77fb730
parentCID=ffffffff
createType="vmfs"
# Extent description
RW 83886080 VMFS "VM-Test-A-flat.vmdk"
# The Disk Data Base
#DDB
ddb.adapterType = "lsilogic"
ddb.geometry.cylinders = "4177"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.longContentID = "42aaea66c82f204c77016921c77fb730"
ddb.uuid = "60 00 C2 96 39 06 49 2c-d6 50 6e 19 2e a1 a8 e6"
ddb.virtualHWVersion = "11"
Hit the point! How to calculate the size to be changed? The original size is calculated as follows:
40 GB = 40 * 1024 * 1024 * 1024 / 512 = 83886080
Now we want to compress from 40 GB to 20 GB, so the value should be:
20 GB = 20 * 1024 * 1024 * 1024 / 512 = 41943040
After modification:
# Disk DescriptorFile
version=1
encoding="UTF-8"
CID=c77fb730
parentCID=ffffffff
createType="vmfs"
# Extent description
RW 41943040 VMFS "VM-Test-A-flat.vmdk"
# The Disk Data Base
#DDB
ddb.adapterType = "lsilogic"
ddb.geometry.cylinders = "4177"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.longContentID = "42aaea66c82f204c77016921c77fb730"
ddb.uuid = "60 00 C2 96 39 06 49 2c-d6 50 6e 19 2e a1 a8 e6"
ddb.virtualHWVersion = "11"
Hit the point! Migrate or copy VM to another datastore. After the VMDK is moved, its size becomes
20GB.
Restart the VM, and you will find that the extra space after the compression has disappeared. At this point,
the compression work is finished.
Thứ Sáu, 31 tháng 12, 2021
[VM] how to reduce hard disk for VM on ESXi (VMDK)
MỘT SỐ CÁCH GIÚP DÂY DẪN CÓ ĐƯỢC ÂM THANH HAY
1.Bởi vì tất cả các dây dẫn đều làm suy giảm tín hiệu mà nó truyền đi vì vậy nên sử dụng càng ít dây trong hệ thống càng tốt. Hãy chạy dây ngắn nhất ở mức có thể.
2.Giữ dây loa, dây tín hiệu trái và phải có cùng chiều dài.
3.Nếu bạn có dây dư thì không nên cuốn chúng lại thành những vòng gọn gàng và đặt ở phái sau loa hoặc các kệ để thiết bị. Điều này sẽ làm cho dây dễ bị cảm ứng và thay đổi tính chất. Thay vào đó, nên mắc dây loa lên để các vòng mắc chéo với nhau theo những góc đúng của nó.
4.Một cách định kỳ, tháo tất cả dây ra và làm sạch chúng. Sự oxi hóa sẽ hình thành trên các đầu cắm và lỗ cắm gây ra những cản trở cho sự dẫn điện. Sử dụng một bộ lau chùi dành riêng thường được bán ở các cửa hàng bán những sản phẩm âm thanh cao cấp. Nó thưc sự sẽ có hiệu quả. Âm thanh trong hệ thống của bạn sẽ nghe hay hơn ngay cả khi dây dẫn thực chất không còn tốt lắm.
5.Khi gắn hoặc tháo các đầu cắm RCA, luôn chỉ nắm ở phần đầu cắm chứ không được nắm phần dây để kéo ra. Nhớ nhấn nút khoá khi tháo đầu cắm XLR.
6.Đảm bảo tất cả các đầu cắm đều được gắn chặt nhất là đầu cắm càng cua trên ampli công suất và loa. Tận dụng tất cả bề mặt tiếp xúc giữa đầu cắm càng cua và lỗ cắm, sau đó siết chặt vào trạm cắm. 7.Chạy dây cách xa các dây điện nguồn. Nếu bắt buộc phải chạy chúng gần nhau thì nên chạy dây dẫn vuông một góc 90 độ với dây điện nguồn. Không bao giờ để dây dẫn và dây điện chạy song song cạnh bên nhau.
8.Giữ các dây tín hiệu digital cách xa với dây tín hiệu analog. Tín hiệu nhiễu của tần số cao phát ra từ dây digital có thể sẽ ảnh hưởng đến dây analog.
9.Tránh đặt những chỗ uốn cong đột ngột trong dây dẫn.
How to install .NET Framework 3.5 on Windows Server 2012 and Windows Server 2012 R2
If you have an application that you want to run on Windows Server 2012 that requires the .NET Framework 3.5, you will most likely run in to a problem when trying to install it. If you are trying to install .NET Framework 3.5 from the Server Manager GUI, you will see this when installing the feature: “Do you want to specify an alternate source path? One or more installation selections are missing source files…” Bug when adding .net framework 3.5 in Server 2012 To solve this, you can either:
1. Go to a command prompt and enter this: dism /online /enable-feature /featurename:NetFX3 /all /Source:d:\sources\sxs /LimitAccess Note: Source should be the Windows installation disc. In my case, this was located on D: Bug when adding .net framework 3.5 in Server 2012
2. Go down to “Specify an alternate source path” and enter “d:\sources\sxs” as the path. Specify alternate source path windows server 2012 .net framework 3.5 Specify alternate source path windows server 2012 .net framework 3.5 Now you should see this under your Features list: .NET Framework 3.5 feature installed on Windows Server 2012
Auto login Windows
You will need to have an account with a password for this to work.
Run regedit.exe
Navigate to HKLM\Software\Microsoft\Windows NT\CurrentVersion\winlogon
Set or create the following keys
(String) AutoAdminLogon = 1
(String) DefaultUserName = Your user name
(String) DefaultPassword = Your password
Restart and let us know if it works!
Thứ Ba, 18 tháng 6, 2013
Cài đặt máy in Canon LBP trên distro họ Ubuntu
Lưu ý: các máy in Canon LBP 1120, 1210, 2900i, 3000, 3200, 3210, 3300, 3600 và 5000 cũng có thể cài đặt tương tự, chỉ cần thay những chỗ có số "2900" thành số máy in của bạn.
http://support-au.canon.com.au/contents/AU/EN/0900772408.html
(phiên bản hiện nay là: CAPT_Printer_Driver_for_Linux_V200_uk_EN.tar.gz)
Bước 2: Giải nén rồi cài đặt 2 file "deb" có trong thư mục: CAPT_Printer_Driver_for_Linux_V200_uk_EN → Driver → Debian
Đối với phiên bản 32-bit thì lần lượt nhấp đúp vào 2 file để cài, hoặc mở Terminal, vào thư mục đã nêu ở trên và chạy 2 lệnh:
sudo dpkg -i cndrvcups-common_2.00-2_i386.deb
sudo dpkg -i cndrvcups-capt_2.00-2_i386.deb
Đối với phiên bản 64-bit thì chạy lần lượt 2 lệnh:
sudo dpkg -i --force-architecture cndrvcups-common_2.00-2_i386.deb
sudo dpkg -i --force-architecture cndrvcups-capt_2.00-2_i386.deb
Bước 3: Khởi động lại CUPS:
Trong Terminal chạy lệnh:
sudo /etc/init.d/cups restart
Bước 4: Bật máy in và kiểm tra xem đã nhận được máy in chưa:
Trong Terminal chạy lệnh:
sudo tail /var/log/messages
Nếu ở gần cuối có đoạn dạng như sau là máy in đã được nhận ra: "usblp0: USB Bidirectional printer dev 4 if 0 alt 0 proto 2 vid 0x04A9 pid 0×2676"
Bước 5: Đăng ký máy in tại spooler:
Trong Terminal chạy lệnh:
sudo /usr/sbin/lpadmin -p LBP2900 -m CNCUPSLBP2900CAPTK.ppd -v ccp:/var/ccpd/fifo0 -E
Bước 6: Đăng ký máy in tại CCPD daemon setupfile:
Trong Terminal chạy lệnh:
sudo /usr/sbin/ccpdadmin -p LBP2900 -o /dev/usb/lp0
Nếu thành công sẽ có một thông báo dạng như sau:
Entry Num : Spooler : Backend : FIFO path : Device Path : Status
—————————————————————————-
[0] : LBP2900 : usb : //Canon/LBP2900 : /dev/usb/lp0 : New!!
Bước 7: Khởi động CCPD daemon:
Trong Terminal chạy lệnh:
sudo /etc/init.d/ccpd start
Bước 8: Thiết lập cho CCPD daemon tự động khởi động:
- Vào "System -> Preferences -> Startup Applications"
- Tạo một mục mới, đặt tên là: CCPD deamon
- Nhập vào dòng lệnh: sudo /etc/init.d/ccpd start
Bước thêm: Nếu muốn kiểm tra tình trạng máy in:
Trong Terminal, chạy lệnh:
captstatusui -P LBP2900
Lệnh này cũng hay dùng. Ví dụ như khi đang in mà hết giấy, thì ta cần bật cửa sổ trạng thái máy in lên và ra lệnh "resume" để in nốt.
Bước 9: Bây giờ, khi khởi động lại máy tính thì Ubuntu sẽ tự nhận và tạo một máy in mới tên là "LBP2900-2", do vậy ta cần Disable (tắt Enable) máy in đó, rồi Set As Defaults đối với máy in LBP2900

Bước thêm: Nên đặt lệnh tắt cho chuỗi lệnh sau:
sudo /etc/init.d/ccpd restart && sudo /etc/init.d/cups restart
Dùng trong trường hợp nếu có lỗi gì đó không in được thì ta lại khởi động lại CCPD daemon và CUPS daemon.
Ghi chú: Để đặt lệnh tắt cho một lệnh hoặc một chuỗi lệnh ta khai báo vào file: ~/.bashrc (Tức là file ẩn tên là ".bashrc" nằm trong thư mục "/home/tên_người_dùng")
Ví dụ: Để đặt lệnh tắt cho 2 lệnh nói ở trên (ở 2 Bước thêm) ta làm như sau:
Trong Terminal chạy lệnh:
gedit ~/.bashrc
Trong cửa sổ trình soạn thảo "gedit" vừa mở ra, ta thêm vào cuối cùng 2 dòng:
alias lbp=’captstatusui -P LBP2900′
alias lbp2900=’sudo /etc/init.d/ccpd restart && sudo /etc/init.d/cups restart’
Ở đây, "lbp" và "lbp2900" là lệnh tắt cho 2 lệnh ta cần.
Thứ Năm, 7 tháng 3, 2013
Remote session was disconnected because there are no Remote Desktop client access licenses available for this computer. Please contact the server administrator
on the server/client your are trying to connect from.
(trhe entire key, don’t worry, it will be recreated automatically ).
Chủ Nhật, 2 tháng 12, 2012
Fix error "Can't Update Avira 12"
62.146.66.187 personal.avira-update.com personal.avira-cdn.com
80.190.143.232 personal.avira-update.net
80.190.143.229 perspeak.avira-update.comChủ Nhật, 7 tháng 10, 2012
Phim tắt vào Bios Sony Vaio, HP, Lenovo, Dell Acer, Asus
Vào Bios ------- nhấn F2
Recovery --------nhấn F10
Để boot vào đĩa CD/DVD thì các bạn cho đĩa vào ổ đĩa rồi khởi động lại máy, máy sẽ tự động boot vào ổ đĩa.(vì dòng SONY mạc định là boot ổ CD/DVD đầu tiên rồi).
HP – Compaq
Vào Bios ------nhấn F10
Chọn boot - ---nhấn F9
Recovery--- ---nhấn F11
Lenovo Thinkpad
Vào Bios--------nhấn F1
Chọn boot-------nhấn F12
Recovery--------nhấn phím xanh ThinkVantage
Dell
Vào Bios-------nhấn F2
Chọn boot-------nhấn F12
Recovery----------nhấn F8 rồi chọn Repair your Computer
Acer
Boot của Acer là F12 + vào bios F2 (thường chức năng menu boot bị disible phải vào enale mới bấm F12 được)
Asus
Boot của Asus là ESC + vào Bios là F2
ARP Cache
What is the Address Resolution Protocol (ARP)?
ARP or the Address Resolution Protocol is primarily used to connect the OSI Model Network Layer (Layer 3) to the Data Link Layer (Layer 2). For most networks this refers to the linking of IP addresses to MAC addresses in Ethernet addressing. For a computer or other networking capable device to be able to communicate with another, the Ethernet MAC address must be known. If the desired recipient of the transmission is located outside of a LAN, the router or default gateway’s MAC address must be known for the computer to send outgoing messages.How Does ARP Cache Work?
ARP cache makes use of two types of entry: static and dynamic. The majority of the time, dynamic ARP cache entries are made. For the dynamic scheme, the ARP entry (the MAC address to IP address mapping) is kept on the computer or networked device for a set amount of time (normally for the length of time that it is being used). For static entries, the mapping is manually entered representing the Ethernet MAC to IP address mapping. Due to the management overhead required with static entries, dynamic ARP is primarily used in modern computing equipment.A dynamic ARP entry is created by using the ARP protocol. Once a website or host is resolved to an IP address using a DNS server, the computer will send an ARP request. The message is sent to the LAN first requesting the Ethernet MAC address for the desired IP address. If located on the local LAN, the computer or server with the IP address will respond with the corresponding MAC address which is entered into the requesting devices ARP cache. The entry will remain until not being used or the ARP cache times out. Routers also maintain their own ARP cache. The ARP cache for a switch will also store the MAC addresses connected to respective ports on the switch.
How Do You Display the ARP Cache?
Display ARP Cache in WindowsStep 1 – Open the Windows command prompt by selecting the “Start” menu button and entering “command” in the search text field.
Step 2 – Type “arp –a” followed by pressing the “Enter” key to view the ARP cache displayed on the DOS console.
C:>arp -a
Interface: 192.168.1.101 — 0×80004
Internet Address Physical Address Type
192.168.1.1 00-0d-6d-bc-a8-6b dynamic
192.168.1.2 00-0e-1c-2b-e5-3c dynamic
Display ARP Cache in Unix
Step 1 – Open the Unix console.
Step 2 – Enter “arp –a” followed by pressing the “enter” or “return” key on your computer’s keyboard and view the ARP cache contents subsequently displayed.
$ arp -a
www.tech-faq.com (192.168.1.2) at 00:34:c4:45:73:21 on fxp0 permanent [ethernet]
fw.tech-faq.com (192.168.1.1) at 00:34:62:a1:c2:00 on fxp0 [ethernet]
What Are the Benefits of ARP Cache?
ARP cache helps save computer and networking resources by saving the MAC to IP address mapping required for network communication. As a result, it is an enabler for the Address Resolution Protocol by further accelerating the methods of locating host hardware addresses when the network layer is known through DNS lookup.What Are the Symptoms of a Faulty ARP Cache?
With time, ARP cache entries can become stale. It is possible for additional entries to the ARP cache table to be made without removing expired entries from the stored table. Eventually, this will result in errors that can significantly impact computer or network performance. Some of the symptoms seen when the ARP cache requires clearing include web pages that fail to load and the failure to ping various IP addresses.How to Clear ARP Cache in Windows XP, Vista, and 2K
Clear ARP Cache from the MS DOS PromptStep 1 – Login to your computer with an account that has administrator permissions.
Step 2 – Select the “Start” menu button. On Windows XP and Windows 2K select the “Run” menu option. Then enter “cmd” or “command” in the run text box followed by clicking the “enter” key. On Windows Vista and newer versions of the OS enter the word “command” in the search text field followed by pressing the “enter” key.
Step 3 – Enter “netsh interface ip delete arpcache” at the command prompt and press the “enter” key.
Step 4 – Wait for approximately 30 seconds to 20 minutes based on the size of the ARP cache table and speed of your computer for the dynamic ARP cache to be cleared.
Clear ARP Cache from Windows Control Panel
In the event you are not able to clear ARP cache from the DOS prompt or just are not comfortable conducting command line tasks, it is possible to clear ARP cache on the Windows OS from Windows Control Panel.
Step 1 – Select the “Start” menu button followed by choosing the “Control Panel” icon.
Step 2 – Depending on the version of Windows OS on the computer and the “view type” selected for Windows Control Panel, you may or may not need to choose the “Performance and Maintenance” menu option.
Step 3 – Choose the “Administrative Tools” menu option followed by the “Computer Management” menu choice.
Step 4 – Select the “Services and Applications” menu button located on the right-hand side of the screen.
Step 5 – Scroll down the menu options until you locate the “Routing and Remote Services” menu option.
Step 6 – Choose the “Routing and Remote Services” menu tab and a dialogue window will then open.
Step 7 – Select the drop-down menu and choose the “Disabled” option followed by clicking the “Ok” menu button to save the settings and clear the ARP cache.
Step 8 – Restart your computer and enabled the “Routing and Remote Services” menu option selected in step 7 to complete clearing the ARP cache.
How to Clear the APR Cache in Windows 7/Server 2003/2008
Step 1 – Select the “Start” menu button and enter “command” in the search text field followed by pressing the “enter” key.Step 2 – Input the following command at the MS DOS command prompt, “netsh interface ip delete arpcache” and press the “enter” key.
Step 3 – Wait for between 1 – 20 minutes for the ARP cache table to be deleted based on the version of OS installed on the computer. Windows Server 2003/2008 will normally take greater than 10 minutes to complete the task due to storing larger cache tables. Windows 2007 will normally complete the task in under 1-2 minutes.
How to Delete an IP Address from ARP Cache
Step 1 – Open the MS DOS prompt on the computer.Step 2 – input “arp –d <IP address>” with the brackets not being included on the address to remove from ARP cache. For example, arp –d 10.1.1.2 will remove the 10.1.1.2 entry from the ARP table.
Step 3 – Display the ARP table after deleting an entry by entering, “arp –a” at the MS DOS command prompt.
Step 4 – Add a static entry to the ARP table by entering the following command at the MS DOS command prompt, “arp -s <ip address> <mac address>.” An example of a static ARP entry is:
arp -s 157.55.85.212 00-aa-00-62-c6-09
What Do You Do if Clearing ARP Cache Fails?
Clearing ARP cache on a computer running the Microsoft Windows OS can fail due to bugs or conflicts within the OS. When the cache fails to clear, the OS will provide the following message to the end-user:Windows could not finish repairing the problem because the following operation could not be completed:
Clearing the ARP cache
For assistance, contact the person who manages your network
The error is typically thrown with the Windows Routing and Remote Services application is enabled or turned on. For most end-users, this service is not required to be enabled and can be turned off to troubleshoot ARP cache clearing issues.
Step 1 – Select the “Start” menu button and click the “Control Panel” icon.
Step 2 – Change the Control Panel view to “Classic” if currently set to “Category View” and select the “Administrative Tools” menu option.
Step 3 – Select the “Computer Management” menu choice and then double click the “Services and Applications” menu option.
Step 4 – Double click the “Services” menu option and scroll to the “Routing and Remote Services” menu label.
Step 5 – Double click the “Routing and Remote Services” menu button and locate the “Startup Type” field.
Step 6 – Change the option selected to “Disabled” and ensure the service status reflects “Stopped.” If it has not ceased to run, click the “Stop” menu button.
Step 7 – Click the “Ok” menu button and retry clearing ARP cache on your computer.
Thứ Ba, 18 tháng 9, 2012
Định dạng USB chuẩn NTFS
CMD
convert g: /fs:ntfs /v
Nếu báo lỗi thì thêm
CMD
chkdsk g: /f
convert g: /fs:ntfs /v
Thứ Bảy, 28 tháng 7, 2012
Linux Networking Setup
Required InformationTo enable networking, you must configure your network interface card or cards with an IP address and netmask. The kernel must have support for your cards compiled in, either as modular support or direct support. If you don't have kernel support read the sections about the kernel and how to compile it. To set your cards up, do the following. In my example my network is 192.168.1.0, IP=192.168.1.100, broadcast=192.168.1.255, netmask=255.255.255.0, gateway-192.168.1.1, nameserver=192.168.1.10.
|
Configuration tools
There are many network configuration tools today. They are:| netconf | A GUI interactive interface available on Redhat 6.1 | |
| linuxconf | A GUI interactive interface available on Redhat 6.1 which includes netconf configuration. | |
| netconfig | A GUI step by step interface | |
| ifconfig | A text based program to configure the network interface. Type "man ifconfig" for info. |
- /etc/sysconfig/network - Defines your network and some of its characteristics.
- /etc/HOSTNAME - Shows the host name of this host. IF your name is "myhost" then that is exactly the text this file will contain.
- /etc/resolv.conf - Specifies the domain to be searched for host names to connect to, the nameserver address, and the search order for the nameservers.
- /etc/host.conf - Specifies the order nameservice looks to resolve names.
- /etc/hosts - Shows addresses and names of local hosts.
- /etc/networks - Provides a database of network names with network addresses similar to the /etc/hosts file. This file is not required for operation.
- /etc/sysconfig/network-scripts/ifcfg-eth* - There is a file for each network interface. This file contains the IP address of the interface and many other setup variables.
Analysis Tools
- netstat - Displays information about the systems network connections, including port connections, routing tables, and more. The command "netstar -r" will display the routing table.
- traceroute - This command can be used to determine the network route from your computer to some other computer on your network or the internet. To use it you can type "route IPaddress" of the computer you want to see the route to.
- nslookup - Used to query DNS servers for information about hosts.
- arp - This program lets the user read or modify their arp cache.
- tcpdump - This program allows the user to see TCP traffic on their network.
- dig(1) - Send domain name query packets to name servers for debugging or testing.
Manual Configuration
You can use one of the above tools or configure the network the old fashioned way as follows:- First to use networking on any permanent basis you should setup the file /etc/sysconfig/network similar to the example shown below.
- Assign an ip address with "ifconfig eth0 192.168.1.100 netmask 255.255.255.0 up".
- Tell your machine that a hub is ready for information with the command "route add -net 192.168.0.0 netmask 255.255.255.0 eth0"
- To contact hosts outside your network if a machine with IP address 192.168.1.1 is the gateway use the command "route add default gw 192.168.1.1 eth0"
- If using a dialup connection use the command "route add default
ppp0" The word default says if the packet is not for a machine on your
local network, send it to the default device.
DEVICE="eth0" IPADDR="192.168.1.100" NETMASK="255.255.0.0" ONBOOT="yes" BOOTPROTO="none" IPXNETNUM_802_2="" IPXPRIMARY_802_2="no" IPXACTIVE_802_2="no" IPXNETNUM_802_3="" IPXPRIMARY_802_3="no" IPXACTIVE_802_3="no" IPXNETNUM_ETHERII="" IPXPRIMARY_ETHERII="no" IPXACTIVE_ETHERII="no" IPXNETNUM_SNAP="" IPXPRIMARY_SNAP="no" IPXACTIVE_SNAP="no"Unless you know what you're doing it is best to use a network configuration tool. I cannot guarantee the accurateness of how to set these files up on your system.
Configuring an interface for multiple IP addresses
If you want to configure your network card to act as more than one IP address, issue the following command:To make it effective, you must reboot your system or issue the command "/etc/rc.d/init.d/network restart" as root.
Dynamically allocated IP addresses
To get the IP address of a dynamically allocated network interface in a script file enter the following:Networking file formats, examples and considerations
Below are listed some more in depth information about the networking files.- /etc/sysconfig/network
The /etc/inittab file contains the entry "si::sysinit:/etc/rc.d/rc.sysinit" which causes the system at startup to run the rc.sysinit script. The rc.sysinit file expects to find the file /etc/sysconfig/network if networking is to be enabled.
The network file looks like this:NETWORKING=yesWhere GATEWAYDEV is the network interface card that is attached to the network the gateway machine is on. The GATEWAY is the actual IP address of the gateway machine.
FORWARD_IPV4=false
HOSTNAME=mymachine.mycompany.com
DOMAINNAME=mycompany.com
GATEWAY=192.168.1.1
GATEWAYDEV=eth0
- /etc/hosts - Defines local hosts.
127.0.0.1 localhost localhost.localdomain 192.168.1.100 mymachine.mycompany.com mymachine
- /etc/services - Internet network services list. It associates port numbers with names of services. The file contains three fields which are name, port/protocol, and aliases with an optional comment.
- /etc/protocols - Describes DARPA internet protocols available
from the TCP/IP subsystem. Maps protocol ID numbers to protocol names.
It includes protocol name, number, and aliases. The protocol file on
my system:
# /etc/protocols: # $Id: protocols,v 1.1 1995/02/24 01:09:41 imurdock Exp $ # # Internet (IP) protocols # # from: @(#)protocols 5.1 (Berkeley) 4/17/89 # # Updated for NetBSD based on RFC 1340, Assigned Numbers (July 1992). ip 0 IP # internet protocol, pseudo protocol number icmp 1 ICMP # internet control message protocol igmp 2 IGMP # Internet Group Management ggp 3 GGP # gateway-gateway protocol ipencap 4 IP-ENCAP # IP encapsulated in IP (officially ``IP'') st 5 ST # ST datagram mode tcp 6 TCP # transmission control protocol egp 8 EGP # exterior gateway protocol pup 12 PUP # PARC universal packet protocol udp 17 UDP # user datagram protocol hmp 20 HMP # host monitoring protocol xns-idp 22 XNS-IDP # Xerox NS IDP rdp 27 RDP # "reliable datagram" protocol iso-tp4 29 ISO-TP4 # ISO Transport Protocol class 4 xtp 36 XTP # Xpress Tranfer Protocol ddp 37 DDP # Datagram Delivery Protocol idpr-cmtp 39 IDPR-CMTP # IDPR Control Message Transport rspf 73 RSPF #Radio Shortest Path First. vmtp 81 VMTP # Versatile Message Transport ospf 89 OSPFIGP # Open Shortest Path First IGP ipip 94 IPIP # Yet Another IP encapsulation encap 98 ENCAP # Yet Another IP encapsulation
- /etc/named.conf - Used for domain name service to configure named. Other files used are dependent on this file. This file is explained further in the DNS section
- /etc/resolv.conf - Specifies the domain to be searched for host
names to connect to, the nameserver address, and the search order for
the nameservers.
domain mycompany.com search mycompany.com mynet.net nameserver 192.168.1.100 nameserver 192.168.199.1 nameserver 192.168.1.10
The third line specifies that DNS should be tried on my machine first then use the normal nameserver on the fifth line. The fourth line specifies that my machine is running nameservices on another network which is using interface 192.168.199.1. This assumes the nameserver is set up on my machine which is explained in another section.
- /etc/host.conf - Specifies the order nameservice looks to resolve names. An example file:
order hosts, bind multi on nospoof on
The order specifies that when resolving names to first look in the /etc/host file, then use BIND8 (DNS) to resolve the name. The line "multi on" specifies that all valid addresses for a host found in the hosts file should be returned.
Older X windows configuration
In Xwindows a working configuration is set up as follows:- NAMES:
- hostname: mymachine.mycompany.com
- Domain: mycompany.com
- Nameservers: 192.168.1.10
- HOSTS:
- IP - 192.168.1.100
- Name - mymachine.mycompany.com
- INTERFACES:
- Interface - eth0
- IP- 192.168.1.100
- proto - none
- atboot - yes
- Netmask: 255.255.255.0
- Network: 192.168.1.0
- Broadcast: 192.168.1.255
- ROUTING:
- Default gateway: 192.168.1.1
- Default gateway device: eth0
- Interface - 192.168.1.100
- Network Address - 192.168.1.0
- Network gateway 192.168.1.1
- Netmask - 255.255.255.0
Routing
Routing table information is used to route incoming and outgoing network diagrams to other machines. On most simple configurations, there are three routes. One for sending packets to your own machine, one for sending packets to other machines on your network and one for sending packets to other machines outside your network through the gateway. Two programs (ifconfig and route) are used to configure these parameters. They are described in more detail in the routing section.Enable SSH in ESX Server
Changing the IP address, default gateway, and hostname of the Service Console in ESX
Details
Solution
Note: To change the IP network information on an ESXi host, see
.
Changing settings from the physical or remote console connection
Changing the IP for the Service Console must be done from the physical console or through a remote console session. If you make changes through a network connection such as SSH, network connectivity to the Service Console disconnects because the Service Console's network interface changes.- Run this command to set the IP address:
[root@server root]# esxcfg-vswif -i a.b.c.d -n w.x.y.z vswif0wherea.b.c.dis the IP address andw.x.y.zis the subnet mask.
Note: In this example,vswif0is the Service Console adapter that is the interface to which you are applying the IP address change.
- Open the
/etc/hostsfile with a text editor and modify it so that it reflects the correct IP address and hostname.
Note: You may also need to verify and change the file /etc/vmware/esx.conf file for the hostname and IP address.
- To change the default gateway address and the hostname, edit the
/etc/sysconfig/networkfile and change the GATEWAY and HOSTNAME parameters to the proper values. - For the changes to take place, restart the network service with the command:
[root@server root]#service network restart
Note: If you are required to edit the hostname, then you must reboot the host.
Note: This command breaks any current network connections to the Service Console, but virtual machines continue to have network connection. If the ESX host is managed by VirtualCenter or vCenter Server, you may have to remove and re-add the host to the inventory. For more information, see ESX not working properly in VirtualCenter after IP address change (1005633).
Note: If the changed IP does not persist across a reboot, try deleting and recreating the Service Console vswif management interface. For more information, see Recreating Service Console networking from the command line (1000266).
Changing the hostname without rebooting
To dynamically change the hostname, run the command:[root@server root]# hostname newnameNote: This command creates a temporary hostname change. This change is lost when the system is rebooted.
Changing the DNS server settings
To change the DNS server settings, update the nameserver IPs and search domain in the/etc/resolv.conf file.Changing settings in VMware vSphere or Infrastructure Client
To change the hostname, domain, DNS servers, and default gateway in VMware vSphere or Infrastructure Client:- Highlight the ESX host and click the Configuration tab.
- Click DNS and Routing.
- Click Properties.
- To change the hostname, domain, and DNS servers, click the DNS Configuration tab and enter the appropriate values.
Note: Disable VMware High Availability if you do not want virtual machines to failover during the hostname IP change.
- To change the default gateway, click the Routing tab and enter the appropriate value.
- Reboot the ESX host for the changes to take effect .
- Reconnect the ESX host to vCenter Server with the new IP address.
Generating new certificates for the ESX host
The ESX host generates certificates the first time the system is started. Under certain circumstances, it might be required to force the host to generate new certificates. Typically new certificates only need to be generated if the hostname has been changed or the certificates have been deleted accidentally.Each time you restart the vmware-hostd process, the mgmt-vmware script searches for existing certificate files (
rui.crt and rui.key). If the files cannot be found, new certificate files are generated.To generate new certificates:
- Put the host into Maintenance Mode.
- In the directory
/etc/vmware/ssl, back up any existing certificates by renaming them with these commands:[root@server root]# mv /etc/vmware/ssl/rui.crt /etc/vmware/ssl/orig.rui.crt
[root@server root]# mv /etc/vmware/ssl/rui.key /etc/vmware/ssl/orig.rui.key
Note: If you are regenerating certificates because you accidentally deleted them, you do not have to rename them.
- Reboot your host to allow it to begin using the new certificate, or restart the host services:
- Restart hostd, using this command:
service mgmt-vmware restart
- Restart vmkauthd, using this command:
service vmware-vmkauthd restart
- Restart hostd, using this command:
- Exit Maintenance Mode.
- Confirm that the ESX host successfully generated new
certificates by running this command and comparing the time stamps of
the new certificate files with
orig.rui.crtandorig.rui.key:[root@server root]# ls -la /etc/vmware/ssl/rui*
- Disable VMware High Availability if you do not want virtual machines to failover during the hostname IP change. If you are using vSphere 4.x you can just disable host monitoring in the HA settings.
- For related information, see Verifying ESX host networking configuration on the service console (1003796).
- You may be required to regenerate your SSL certificate. For more information, see Replacing or Regenerating an SSL Certificate for the Management Interface (1843).
- You are required to edit files on an ESX host. For more information, see Editing files on an ESX host using vi or nano (1020302).
- For information on replacing VirtualCenter Server certificates, see:
- The iSCSI Qualified Name used for iSCSI storage configuration is based on the hostname of the ESX host. If you change the hostname of the ESX host, ensure to review your iSCSI software initiator configuration. For more information on iSCSI troubleshooting, see Configuring and troubleshooting basic software iSCSI setup (1008083).
- For more information on changing the hostname, see Changing the name of an ESX or ESXi host (1010821).
Thứ Hai, 23 tháng 7, 2012
SQLDMO has not been registered, please re-run SQL Server setup and contact your system administrator
When I running the Microsoft sql server enterprise manager, it raise an error of "SQLDMO has not been registered, please re-run SQL Server setup and contact your system administrator." What is the problem. My sql server has already been installed and it runs very well until today.
To solve this problem is an easy way. That is, at the Command prompt, run this command line: regsvr32 sqldmo.dll. Well, notice that if the command can not be successfully executed, then you might have to switch to the folder (use command 'cd') where the dll file lives.
Thứ Hai, 9 tháng 7, 2012
FIX: Error message when you try to install SQL Server 2000: "Unable to validate product key"
To resolve this problem, follow these steps:
- In the SQL Server Installation Wizard, click Cancel.
- Start Registry Editor. To do this, click Start, click Run, type regedt32, and then click OK.
- Locate and then double-click the SafeDllSearchMode registry entry.
On a server that is running Windows Server 2003 or Windows Storage Server 2003, this registry entry is located under the following registry subkey:On a server that is running Windows 2000 with SP4, this registry entry is located under the following registry subkey:HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session ManagerNote If the SafeDllSearchMode registry entry does not exist, create the SafeDllSearchMode registry entry as the DWORD value.HKEY_LOCAL_MACHINE\System\Control\Session Manager - In the Value data box, change the value from 1 to 0, and then click OK.
- Exit Registry Editor.
- Reinstall SQL Server 2000, and then install the latest SQL Server 2000 service pack.
- Restart the server.
Thứ Ba, 27 tháng 9, 2011
Sửa lỗi Windows Installer
1. Vào Start > Run, gõ lịnh msiexec /unregister .
2. Đổi tên các file Msi.dll, Msiexec.exe, và Msihnd.dll trong thư mục Windows\System32.
3) Khởi động lại Windows.
4) Cài đặt lại chương trình Windows Installer (tải phiên bản v2.0 cho Windows 95/ 98/ Me tại địa chỉ http://www.microsoft.com/downloads/d...2-DE3BB768148F, tải phiên bản v3.1 cho Windows NT/2000/XP tại địa chỉ http://www.microsoft.com/downloads/d...displaylang=en).
Thứ Sáu, 9 tháng 9, 2011
Xét Windows Server 2003 tự động đăng nhập khi khởi động
HKLM->Software->Microsoft->Windows NT->CurrentVersion->Winlogon
- Xét AutoAdminLogon giá trị là 1
- Xét giá trị DefaultUserName và DefaultDomain muốn đăng nhập
- Tạo 1 key string DefaultPassword và nhập vào password đăng nhập.
- Tạo 1 key string ForceAutoLogon và gán giá trị là 1
Khởi động lại
Thứ Sáu, 12 tháng 8, 2011
Định nghĩa MTU, MSS và RWIN
MTU (Maximum Tranmission Unit) là đơn vị truyền tải dữ liệu lớn nhất của modem, số lượng dữ liệu lớn nhất hay kích thước lớn nhất có thể của 'gói' dữ liệu (packet). Gói dữ liệu này còn chứa cả thông tin về tiêu đề, nội dung truyền tải (header and trailer).
Mức MTU tối ưu cho modem ADSL và ADSL 2+ là 1492, MTU cho truyền hình cáp như Medianet và SCTV (Cable connection) là 1500. MTU có thể chỉnh sửa trong Modem/Router
MSS là gì ?:
MSS (Maximum Segment Size) là kích thước mảnh dữ liệu (data) lớn nhất. Được tính theo công thức : MTU-40 (do không chứa header và trailer)
Mức MSS tối ưu cho ADSL là 1452, MTU cho truyền hình cáp (Cable connection) là 1460.
TCP Window (RWIN) là gì ?:
TCP Window (TCP Receive Window hoặc RWIN) là bộ đệm (buffer) chứa số lượng dữ liệu máy tính chuẩn bị tiếp nhận. Là cấp số nhân chẵn của MSS. Nếu RWIN được xác lập quá lớn thì lượng dữ liệu thất thoát sẽ lớn trong trường hợp gói dữ liệu bị thất lạc hoặc hư hỏng, còn nếu ta chọn quá nhỏ tốc độ truyền dẫn sẽ rất chậm.
Lệnh ip-helper address dùng để làm gì ?
Thứ Ba, 9 tháng 8, 2011
Khắc phục lỗi không joint được vào domain windows
Sửa lại giá trị của "forceguest" thành 0
Nếu chưa có "forceguest" thì tạo DWORD tên "forceguest" và gán giá trị là 0.