๐Ÿ“œ โฌ†๏ธ โฌ‡๏ธ

Moving from Ubuntu to Windows 10, Hyper-V and getting rid of the iron router

Having bought a new laptop, I regretfully noticed that my beloved Ubuntu no longer supports the work of the sensors and the fans are constantly buzzing, making the work not comfortable. At the same time, if you download the pre-installed Windows 10 Pro from the original hard drive, then there is a pleasant silence for the ear. While it was cool outside (and at home), it was tolerable. But as the heat came, patience came to an end. It was decided to migrate to Windows.

In my work, I use numerous virtual machines to build, test, and debug the software being developed. Windows 10 Pro includes Hyper-V virtualization - once the money is paid, you have to use it! In Ubuntu, I used libvirt and virtual machines combined into one internal virtual network.

Transferring Windows from the original disk to the SSD and transforming the virtual machine images into hyper-v format, with a pain in my heart, I began to master the new operating system.

It turned out not so scary! Virtual desktops were replaced with windows desktops (unfortunately only horizontal), the console replaced the WSL console (Windows Subsystem for Linux), X11 applications were installed and added to VcXsrv autorun, virtual machines started working in Hyper-V, and even OSX was launched.
')
The native terminal was not entirely convenient and without tabs, so it was mercilessly replaced by the xfce4 terminal, which is launched via a shortcut with a hidden console linux window:

image

An object:

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/429856/


All Articles