Migration d'Ubuntu vers Windows 10, Hyper-V et se débarrasser d'un routeur Iron

Après avoir acheté un nouvel ordinateur portable, j'ai regretté que mon bien-aimé Ubuntu ne supporte plus les capteurs et les ventilateurs bourdonnent constamment, rendant le travail inconfortable. Dans le même temps, si vous téléchargez Windows 10 Pro préinstallé à partir du disque dur d'origine, il y aura un silence agréable pour l'oreille. Alors qu'il faisait frais dehors (et à la maison), c'était supportable. Mais comme la chaleur est venue, la patience a pris fin. Il a été décidé de migrer vers Windows.

Dans mon travail, j'utilise de nombreuses machines virtuelles pour créer, tester et déboguer des logiciels développés. Windows 10 Pro inclut la virtualisation Hyper-V - une fois l'argent payé, vous devez l'utiliser! Dans Ubuntu, j'ai utilisé libvirt et des machines virtuelles dans un réseau virtuel interne.

En transférant Windows du disque d'origine vers le SSD et en convertissant les images des machines virtuelles au format hyper-v, avec chagrin d'amour, j'ai commencé à développer un nouveau système d'exploitation.

Il s'est avéré pas si effrayant! Les bureaux virtuels ont été remplacés par des bureaux Windows (malheureusement uniquement horizontaux), la console a remplacé la console WSL (Windows Subsystem for Linux), VcXsrv a été installé et ajouté au programme de démarrage des applications X11, les machines virtuelles ont commencé à fonctionner en Hyper-V et ont même réussi à démarrer OSX.

Le terminal natif s'est avéré ne pas être entièrement pratique et sans onglets, il a donc été impitoyablement remplacé par le terminal xfce4, qui est lancé via un raccourci avec une fenêtre de console Linux cachée:

image

Objet

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


All Articles