docker Daemon 代理

sudo mkdir -p /etc/systemd/system/docker.service.d
sudo tee /etc/systemd/system/docker.service.d/http-proxy.conf <<-'EOF'
[Service]
Environment="HTTP_PROXY=http://proxy.example.com:8080"
Environment="HTTPS_PROXY=http://proxy.example.com:8080"
Environment="NO_PROXY=localhost,127.0.0.1,.example.com"
EOF

bcdedit 启动 win10pe

bcdedit /create {ramdiskoptions} /d "win 10 pe"
bcdedit /set {radiopticons} ramdisksdidevice partition=D:
bcdedit /set {ramdiskoptions} ramdisksdipath \win10\Boot\boot.sdi
Bcdedit /create /d "Boot from Wim" /application osloader

运行完上面会生成guid,替换下面的guid

bcdedit /set {acd191c6-69d3-11ed-80cd-c9ce13ba6396} device ramdisk=[D:]\win10\Sources\boot.wim,{ramdiskoptions}
bcdedit /set {acd191c6-69d3-11ed-80cd-c9ce13ba6396} osdevice ramdisk=[D:]\win10\Sources\boot.wim,{ramdiskoptions}
bcdedit /set {acd191c6-69d3-11ed-80cd-c9ce13ba6396} path \windows\system32\boot\winload.exe
bcdedit /set {acd191c6-69d3-11ed-80cd-c9ce13ba6396} systemroot \windows
bcdedit /set {acd191c6-69d3-11ed-80cd-c9ce13ba6396} winpe yes
bcdedit /set {acd191c6-69d3-11ed-80cd-c9ce13ba6396} detecthal yes
bcdedit /displayorder {acd191c6-69d3-11ed-80cd-c9ce13ba6396} /addlast

windows 更新时间

https://learn.microsoft.com/en-us/windows-server/networking/windows-time-service/windows-time-service-tools-and-settings?tabs=config

1.更新time server

w32tm /config /manualpeerlist:"3.openwrt.pool.ntp.org time.ustc.edu.cn ntp1.aliyun.com" /syncfromflags:manual /update


w32tm /config /update /manualpeerlist:"0.pool.ntp.org,0x8 1.pool.ntp.org,0x8 2.pool.ntp.org,0x8 3.pool.ntp.org,0x8" /syncfromflags:manual

2.更新一次时间

w32tm /resync

hyper添加nvdia虚拟显卡

#如虚拟机名称为win10
Set-VM -Name "win10" -AutomaticStopAction TurnOff
Set-VM -GuestControlledCacheTypes $true -VMName "win10"

# 设置MMIO,总的io映射内存,我们直接设置为32GB(通用大小),出现其他问题再扩大即可
Set-VM -LowMemoryMappedIoSpace 1Gb -VMName "win10"
Set-VM -HighMemoryMappedIoSpace 32Gb -VMName "win10"

# 添加虚拟化,
Add-VMGpuPartitionAdapter -VMName "win10"

# 指定显卡添加,这个显卡ID通过Get-VMHostPartitionableGpu命令获取到的“Name”字段值
# 注意,低版本的window10是无法使用这个命令指定的
# Add-VMGpuPartitionAdapter -VMName "win10" -InstancePath "显卡ID"
# 例如我的显卡ID是:\\?\PCI#VEN_10DE&DEV_1F91&SUBSYS_1AB11043&REV_A1#4&1885b93c&0&0008#{064092b3-625e-43bf-9eb5-dc845897dd59}\GPUPARAV


# 添加后,设置自动配置显卡
Set-VMGpuPartitionAdapter -VMName "win10"


# 删除虚拟显卡的分配,配置错误可重新来
Remove-VMGpuPartitionAdapter -VMName "win10"


我们先复制物理机系统的
C:\Windows\System32\nvapi64.dll
放到虚拟机的:
C:\Windows\System32\nvapi64.dll

再复制物理机中的
C:\Windows\System32\DriverStore\FileRepository
目录中以nv开头的文件夹到虚拟机中的
C:\Windows\System32\HostDriverStore\FileRepository
目录下,其中HostDriverStore\FileRepository目录需要自己创建:
重启虚拟机即可

$vm = "你的虚拟机名称"
Remove-VMGpuPartitionAdapter -VMName $vm
Add-VMGpuPartitionAdapter -VMName $vm
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionVRAM 1
Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionVRAM 11
Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionVRAM 10
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionEncode 1
Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionEncode 11
Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionEncode 10
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionDecode 1
Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionDecode 11
Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionDecode 10
Set-VMGpuPartitionAdapter -VMName $vm -MinPartitionCompute 1
Set-VMGpuPartitionAdapter -VMName $vm -MaxPartitionCompute 11
Set-VMGpuPartitionAdapter -VMName $vm -OptimalPartitionCompute 10
Set-VM -GuestControlledCacheTypes $true -VMName $vm
Set-VM -LowMemoryMappedIoSpace 1GB -VMName $vm
Set-VM -HighMemoryMappedIoSpace 32GB -VMName $vm
Start-VM -Name $vm

windows vpn l2tp/ipsec 服务器位于nat设备后导致客户端连不上

https://learn.microsoft.com/en-us/troubleshoot/windows-server/networking/configure-l2tp-ipsec-server-behind-nat-t-device

1.服务器改注册表
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PolicyAgent
AssumeUDPEncapsulationContextOnSendRule DWORD (32-bit) 2

2.客户端电脑改注册表
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\RasMan\Parameters
ProhibitIPSec DWORD (32-bit) 1
AllowL2TPWeakCrypto DWORD (32-bit) 1
重启电脑