从Ubuntu迁移到Windows 10,Hyper-V和摆脱铁路由器

购买了新笔记本电脑后,我感到遗憾的是,我心爱的Ubuntu不再支持传感器,并且风扇不断发出嗡嗡声,使工作变得不舒服。 同时,如果您从原始硬盘驱动器上下载了预装的Windows 10 Pro,那么耳边会给您带来宁静的感觉。 虽然外面(和家里)很凉爽,但还是可以忍受的。 但是随着热度的到来,耐心结束了。 决定迁移到Windows。

在我的工作中,我使用许多虚拟机来构建,测试和调试开发的软件。 Windows 10 Pro包含Hyper-V虚拟化-一旦付款,就必须使用它! 在Ubuntu中,我在一个内部虚拟网络中使用了libvirt和虚拟机。

将Windows从原始磁盘转移到SSD并将虚拟机的映像转换为hyper-v的格式后,我心痛不已,我开始开发新的操作系统。

原来还没那么吓人! 虚拟桌面已被Windows桌面取代(不幸的是只有水平桌面),控制台取代了WSL(Linux的Windows子系统)控制台,已安装VcXsrv并将其添加到X11应用程序的启动程序中,虚拟机开始在Hyper-V中运行,甚至设法启动OSX。

原来,本机终端并不完全方便,而且没有制表符,因此它被xfce4终端无情地替换了,该终端通过带有隐藏的Linux控制台窗口的快捷方式启动:

图片

对象

C:\Windows\System32\wscript.exe ./runhidden.vbs bash -c "export DISPLAY=:0.0; export GDK_DPI_SCALE=1.2; cd ~; exec xfce4-terminal"

( , X11 ), :

' Simple command-line help.
select case WScript.Arguments(0)
case "-?", "/?", "-h", "--help"
  WScript.echo "Usage: runHidden executable [...]" & vbNewLine & vbNewLine & "Runs the specified command hidden (without a visible window)."
  WScript.Quit(0)
end select

' Separate the arguments into the executable name
' and a single string containing all arguments.
exe = WScript.Arguments(0)
sep = ""
for i = 1 to WScript.Arguments.Count -1
  ' Enclose arguments in "..." to preserve their original partitioning.
  args = args & sep & """" & WScript.Arguments(i) & """"
  sep = " "
next

' Execute the command with its window *hidden* (0)
WScript.CreateObject("Shell.Application").ShellExecute exe, args, "", "open", 0

:

image

, TP-LINK WR703N OpenWRT:

image

VPN . , , WiFi , , WiFi, . WiFi , , .

( ), , . , Windows .

Hyper-V . , . LAN Internal:

image

. , « » — Windows .

WiFi:

image

:

image

Ubuntu 16.04. 16.04? 18.04 /etc/network/interfaces netplan — ! :

image

, Microsoft UEFI .

, ifconfig. WiFi ip . , :
dhclient eth0 eth1 eth2

, dhcp.
eth0 — , eth1 — , eth2 — ( ). 192.168.3.0.

/etc/network/interfaces , , nano:

source /etc/network/interfaces.d/*

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet dhcp

# Internal LAN
auto eth1
iface eth1 inet static
        address 192.168.3.1
        netmask 255.255.255.0
        network 192.168.3.0
        broadcast 192.168.3.255

# The primary network interface
allow-hotplug eth2
iface eth2 inet dhcp

. ( ).

, .

:
sudo apt install dnsmasq iptables-persistent netfilter-persistent openvpn

ip :

cat > /etc/sysctl.d/10-forwarding.conf 
net.ipv4.ip_forward=1

:

cat > /etc/iptables/rules.v4
# Generated by iptables-save v1.6.0 on Fri Jun 22 11:13:10 2018
*nat
:PREROUTING ACCEPT [2901:568651]
:INPUT ACCEPT [707:80315]
:OUTPUT ACCEPT [445:30025]
:POSTROUTING ACCEPT [14:1200]
-A POSTROUTING -o eth0 -j MASQUERADE
-A POSTROUTING -o eth2 -j MASQUERADE
-A POSTROUTING -o tun+ -j MASQUERADE
COMMIT
# Completed on Fri Jun 22 11:13:10 2018
# Generated by iptables-save v1.6.0 on Fri Jun 22 11:13:10 2018
*filter
:INPUT ACCEPT [57264:68964200]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [44820:7558046]
-A FORWARD -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i eth1 -o tun+ -j ACCEPT
COMMIT
# Completed on Fri Jun 22 11:13:10 2018

dhcp :

cat > /etc/dnsmasq.d/router.conf 
dhcp-authoritative
domain-needed
localise-queries
read-ethers
bogus-priv
expand-hosts
local-service
domain=lan
server=/lan/
dhcp-leasefile=/tmp/dhcp.leases

interface=eth1
dhcp-range=lan,192.168.3.100,192.168.3.249,255.255.255.0,12h

Windows !

image

openvpn .

, , ?

— Windows 10 ! . ! …

image

, . , . , , .

, ( — Visual Studio):

image

, , .

github.
, , (, ) Windows NoWiFi.

, , , !

, !

Source: https://habr.com/ru/post/zh-CN429856/


All Articles