1.在vlmcsd/binaries/Linux/intel/glibc/文件夹,找到该文件夹下的vlmcsd-x86-glibc,如果是64位则是vlmcsd-x64-glibc,其他系统自行选择,服务端主要是找vlmcsd这个程序。

2.复制文件

在/usr/local新建vlmcsd,拷贝vlmcsd-x86-glibc到该文件夹下

  1. mkdir /usr/local/vlmcsd
  2. cp vlmcsd-x86-glibc /usr/local/vlmcsd/

给vlmcsd-x86-glibc加入执行权限,并改名为vlmscd

  1. cd /usr/local/vlmcsd/
  2. chmod u+x vlmcsd-x86-glibc
  3. mv vlmcsd-x86-glibc vlmcsd

3.测试启动

./vlmcsd

查看执行的进程

ps aux|grep vlmcsd 

结果

  1. root 8227 0.0 0.0 2364 240 ? Ss 11:41 0:00 ./vlmcsd
  2. root 8279 0.0 0.0 2280 552 pts/1 S+ 11:42 0:00 grep vlmcsd

说明进程已经启动 kill pid可以关闭进程

如果有其他端口占用1688,会报如下错误

  1. Warning: 0.0.0.0:1688: Address already in use
  2. Fatal: Could not listen on any socket

找出占用的进程关闭即可,可以使用lsof命令和netstat命令

上文中supervisor关闭命令为

supervisorctl shutdown 

4.开机自启

把命令加到/etc/rc.local或/etc/rc.d/rc.local,并加上可执行权限,为了查看日志,加上vlmcsd -l /var/log/vlmcsd.log

  1. echo “/usr/local/vlmcsd/vlmcsd -l /var/log/vlmcsd.log > /dev/null 2>&1” >> /etc/rc.local
  2. chmod +x /etc/rc.local

注意:CentOS 7中系统启动管理已经由传统的Linux SysV init改为systemd,配置方法跟原来的不一样

5.重启服务器

reboot

6.客户端测试

windows找到\binaries\Windows\intel目录下的vlmcs-Windows-x86.exe对于64位的找vlmcs-Windows-x64.exe,将其改名为vlmcs.exe;cd跳转到改目录下.执行命令

vlmcs.exe -v -l 3 www.kms123.com

-v输出详细信息
-l 3表示发送Windows Server 2008 Datacenter的激活请求,具体版本对应列表可以通过vlmcs.exe -x查看

www.kms123.com表示KMS服务器的域名

  1. Request Parameters
  2. ==================
  3. Protocol version : 4.0
  4. Client is a virtual machine : No
  5. Licensing status : 2 (OOB grace)
  6. Remaining time (0 = forever) : 43200 minutes
  7. Application ID : 55c92734-d682-4d71-983e-d6ec3f16059f (Windows)
  8. Activation ID (Product) : 68b6e220-cf09-466b-92d3-45cd964b9509 (Windows Server 2008 Datacenter)
  9. Key Management Service ID : 8a21fdf3-cbc5-44eb-83f3-fe284e6680a7 (Windows 2008 C)
  10. Client machine ID : 53532ed6-0511-4848-ad75-40e3944c3b99
  11. Previous client machine ID : 00000000-0000-0000-0000-000000000000
  12. Client request timestamp (UTC) : 2015-12-16 05:39:30
  13. Workstation name : ftp.htc.info
  14. N count policy (minimum clients): 5
  15. Connecting to 1.2.3.4:1688 … successful
  16. Performing RPC bind …
  17. … NDR64 … BTFN … NDR32 … successful
  18. Sending activation request (KMS V4) 1 of 1
  19. Response from KMS server
  20. ========================
  21. Size of KMS Response : 160 (0xa0)
  22. Protocol version : 4.0
  23. KMS host extended PID : 03612-00206-183-962764-03-4108-10240.0000-2582015
  24. Client machine ID : 53532ed6-0511-4848-ad75-40e3944c3b99
  25. Client request timestamp (UTC) : 2015-12-16 05:39:30
  26. KMS host current active clients : 10
  27. Renewal interval policy : 10080
  28. Activation interval policy : 120