<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Start Coding Now - windows</title><link href="https://startcodingnow.com/" rel="alternate"/><link href="https://startcodingnow.com/category/windows/feed" rel="self"/><id>https://startcodingnow.com/</id><updated>2021-04-26T00:00:00-07:00</updated><entry><title>Getting Access to the Wide Internet in Your Hyper-V Virtual Machine</title><link href="https://startcodingnow.com/getting-access-to-the-wide-internet-in-your-hyper-v-virtual-machine" rel="alternate"/><published>2021-04-26T00:00:00-07:00</published><updated>2021-04-26T00:00:00-07:00</updated><author><name>Lance Goyke</name></author><id>tag:startcodingnow.com,2021-04-26:/getting-access-to-the-wide-internet-in-your-hyper-v-virtual-machine</id><summary type="html">&lt;p&gt;I’m using Hyper-V on my workstation to run a Ubuntu Linux virtual
machine.&lt;/p&gt;
&lt;p&gt;I recently moved and changed my office setup. Previously I had a Cat 6
cable into a 2.5G Realtek Ethernet Adapter running into my router, plus
a SFP+ DAC cable running into a 10G switch …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I’m using Hyper-V on my workstation to run a Ubuntu Linux virtual
machine.&lt;/p&gt;
&lt;p&gt;I recently moved and changed my office setup. Previously I had a Cat 6
cable into a 2.5G Realtek Ethernet Adapter running into my router, plus
a SFP+ DAC cable running into a 10G switch to connect to my local
network server.&lt;/p&gt;
&lt;p&gt;With the move, though, I wanted to simplify the setup. I’m no longer
using a Cat 6 cable and 2.5G NIC to get Internet access. Now I’m only
using the small 10 gigabit switch, the Mikrotik CRS305-1G-4S+IN, and
that cable supplies my internal and external network needs.&lt;/p&gt;
&lt;p&gt;I highly recommend this setup even if it’s just for a local connection.
It’s really cool to saturate RAID’ed drive transfer speeds when moving
my videos around. If you’re curious, here’s a longer post detailing how
I did it all: &lt;a class="reference external" href="https://startcodingnow.com/10-gigabit-networking/"&gt;10 Gigabit Networking Between Home Server and
Computer&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The problem is that removing that 2.5G network cable broke my VM’s
internet access.&lt;/p&gt;
&lt;p&gt;In this post, I’ll detail what happened and how to fix it.&lt;/p&gt;
&lt;div class="section" id="losing-internet-access-from-hyper-v-virtual-machine"&gt;
&lt;h2&gt;Losing Internet Access from Hyper-V Virtual Machine&lt;/h2&gt;
&lt;p&gt;How does Hyper-V manage networks? What are “virtual switches”?&lt;/p&gt;
&lt;p&gt;Hyper-V creates a virtual switch to connect your VM to your physical
switch.&lt;/p&gt;
&lt;p&gt;If you open up Hyper-V and right click on the server (the name of the
Hyper-V host, a.k.a. the name of my workstation), you can click on
&lt;strong&gt;Virtual Switch Manager…&lt;/strong&gt; to open up some helpful settings.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="Hyper-V Virtual Switch Manager shows four virtual switches: default switch, an external switch for the Realtek PCIe 2.5GbE network card, a WiFi switch, and a 10GbE switch." src="./images/Hyper-V-Virtual-Switch-Manager.png"/&gt;
&lt;/div&gt;
&lt;p&gt;My workstation has four virtual switches:&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;The first listed there is the Realtek 2.5G network card I created&lt;/li&gt;
&lt;li&gt;The second listed is the default that Hyper-V created&lt;/li&gt;
&lt;li&gt;The third listed is one tied to my WiFi network card that I created&lt;/li&gt;
&lt;li&gt;The fourth listed is one tied to my 10G network card that I created&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;There are quite a few settings when making these virtual switches, but
they are described well.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="how-to-create-a-new-virtual-switch-in-hyper-v"&gt;
&lt;h2&gt;How to Create a New Virtual Switch in Hyper-V&lt;/h2&gt;
&lt;p&gt;When you click on &lt;strong&gt;New virtual network switch&lt;/strong&gt;, the dialog asks what
type it should be.&lt;/p&gt;
&lt;ul class="simple"&gt;
&lt;li&gt;External switches give you access to the outside network&lt;/li&gt;
&lt;li&gt;Internal switches connect your VMs on the same server and your host
OS&lt;/li&gt;
&lt;li&gt;Private switches connect only your VMs on the same server&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;If you want to get wide internet access, you need a new External switch.&lt;/p&gt;
&lt;p&gt;The next screen allows you to pick the “Connection Type”. Since my 10G
network adapter is what I want to use, I selected that.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="Virtual Switch Manager in Hyper-V shows a virtual switch called “10G Switch” using the computer’s Mellanox ConnectX-2 Ethernet Adapter." src="./images/Hyper-V-creating-a-new-External-Virtual-Switch.png"/&gt;
&lt;/div&gt;
&lt;p&gt;Then, I also created one for my WiFi adapter in case my wired connection
is ever down.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="Virtual Switch Manager in Hyper-V shows a virtual switch called “WiFi Switch” using the computer’s Wi-Fi network adapter." src="./images/Hyper-V-creating-a-new-External-Virtual-Switch-with-WiFi-network-adapter.png"/&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="section" id="add-the-new-virtual-switch-to-the-hyper-v-virtual-machine"&gt;
&lt;h2&gt;Add the New Virtual Switch to the Hyper-V Virtual Machine&lt;/h2&gt;
&lt;p&gt;Now that I have made the virtual switch, I need to tell the virtual
machine that it’s there.&lt;/p&gt;
&lt;p&gt;In the Hyper-V manager, right-click on your VM and select &lt;strong&gt;Settings…&lt;/strong&gt;.&lt;/p&gt;
&lt;p&gt;Now, if you previously had a virtual switch there, it’s likely you still
have the network adapter listed there. If you click on it, you can
change the virtual switch.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="Editing settings in Hyper-V for a virtual machine’s network adapter. We select a new virtual switch, in this case one called “10G Switch” that we’ve just created." src="./images/hyper-v-10G-switch-selected.png"/&gt;
&lt;/div&gt;
&lt;p&gt;After hitting &lt;strong&gt;Apply&lt;/strong&gt;, you’ll likely need to re-authenticate into your
VM. But let’s go in and see if we have access to the network now.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="top right corner of ubuntu desktop" src="./images/network-adapter-visible-in-ubuntu.png"/&gt;
&lt;/div&gt;
&lt;p&gt;This little network icon in the top right of the screen gives me hope!
Let’s open the Network settings now.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="Ubuntu desktop network settings dialog" src="./images/wired-network-adapter-present-in-ubuntu-network-settings.png"/&gt;
&lt;/div&gt;
&lt;p&gt;Beautiful! And if we test internet access in the web browser, it works.&lt;/p&gt;
&lt;p&gt;Success!&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="extra-credit-adding-the-wifi-switch-to-our-hyper-v-virtual-machine"&gt;
&lt;h2&gt;Extra Credit: Adding the WiFi Switch to Our Hyper-V Virtual Machine&lt;/h2&gt;
&lt;p&gt;As a backup and as further practice, let’s add the new WiFi switch as
well.&lt;/p&gt;
&lt;p&gt;Back in our virtual machine’s settings, we want to &lt;strong&gt;Add Hardware&lt;/strong&gt;.
Select &lt;strong&gt;Network Adapter&lt;/strong&gt; and click &lt;strong&gt;Add&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="Windows VM settings with Add Hardware &amp;gt; Network Adapter selected" src="./images/add-wifi-switch-to-hyper-v-vm-1.png"/&gt;
&lt;/div&gt;
&lt;p&gt;Then select the correct switch and hit &lt;strong&gt;Apply&lt;/strong&gt;.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="WiFi switch selected" src="./images/add-wifi-switch-to-hyper-v-vm-2.png"/&gt;
&lt;p class="caption"&gt;WiFi switch selected&lt;/p&gt;
&lt;/div&gt;
&lt;p&gt;And then let’s check our network settings in ubuntu again.&lt;/p&gt;
&lt;div class="figure"&gt;
&lt;img alt="Network settings in Ubuntu show two connections: eth0 @ 10000 Mb/s and eth1 @ 234 Mb/s." src="./images/10G-and-wifi-networks-in-ubuntu.png"/&gt;
&lt;/div&gt;
&lt;p&gt;Awesome! If it looks like the network card is there, but you’re getting
a “cable unplugged” message, just make sure your WiFi is turned on in
your host machine.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="conclusion"&gt;
&lt;h2&gt;Conclusion&lt;/h2&gt;
&lt;p&gt;That’s it! I’m excited to be up-and-running once again with my virtual
machine.&lt;/p&gt;
&lt;p&gt;Good luck!&lt;/p&gt;
&lt;/div&gt;
</content><category term="windows"/><category term="10-gigabit-ethernet"/><category term="10-gigabit-networking"/><category term="ethernet"/><category term="hyper-v"/><category term="networking"/><category term="virtual-machines"/><category term="wifi"/><category term="windows"/></entry><entry><title>Fancy New Windows Terminal</title><link href="https://startcodingnow.com/fancy-new-windows-terminal" rel="alternate"/><published>2020-06-07T00:00:00-07:00</published><updated>2020-06-07T00:00:00-07:00</updated><author><name>Lance Goyke</name></author><id>tag:startcodingnow.com,2020-06-07:/fancy-new-windows-terminal</id><summary type="html">&lt;p&gt;I have a buddy who recommended switching to z shell as my terminal. He
showed me some pictures and it looks nice and pretty, so I started
researching.&lt;/p&gt;
&lt;p&gt;Most results suggested installing Cygwin and then using the Cygwin
terminal to install z shell. I went and did all that, it …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I have a buddy who recommended switching to z shell as my terminal. He
showed me some pictures and it looks nice and pretty, so I started
researching.&lt;/p&gt;
&lt;p&gt;Most results suggested installing Cygwin and then using the Cygwin
terminal to install z shell. I went and did all that, it seems cool, but
when I tried that &lt;tt class="docutils literal"&gt;&lt;span class="pre"&gt;apt-cyg&lt;/span&gt; install zsh&lt;/tt&gt;, I received an error that said
the certificate had expired. It wouldn’t install! Let’s try to find
another solution.&lt;/p&gt;
&lt;div class="section" id="enter-windows-subsystem-for-linux"&gt;
&lt;h2&gt;Enter Windows Subsystem for Linux&lt;/h2&gt;
&lt;p&gt;I’ve been wary about trying this. It seems pretty new still, but the
install directly from the Windows store was SO EASY. I have high hopes.&lt;/p&gt;
&lt;p&gt;Just enable Windows Subsystem for Linux, find your Linux distro and
install. I went with Ubuntu because I’m familiar with it.&lt;/p&gt;
&lt;p&gt;I found this article from howtogeek.com to be really helpful: &lt;a class="reference external" href="https://www.howtogeek.com/258518/how-to-use-zsh-or-another-shell-in-windows-10/"&gt;“How to
Use Zsh (or Another Shell) in Windows
10”.&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="install-oh-my-zsh"&gt;
&lt;h2&gt;Install oh-my-zsh!&lt;/h2&gt;
&lt;p&gt;As a total newb, I don’t even know what kind of upgrades I could expect
to make to my shell. &lt;a class="reference external" href="https://www.smashingmagazine.com/2015/07/become-command-line-power-user-oh-my-zsh-z/"&gt;Here’s an article on becoming a command line power
user.&lt;/a&gt;
You’ll walk through the new shell, theme, and adding customization.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="install-powerlevel10k"&gt;
&lt;h2&gt;Install PowerLevel10k&lt;/h2&gt;
&lt;p&gt;Here’s a &lt;a class="reference external" href="https://github.com/romkatv/powerlevel10k"&gt;Z shell theme&lt;/a&gt;
recommended to me. I was on board as soon as I saw the pretty colors,
but I’ll probably stay forever due to the Dragon Ball Z nostalgia.&lt;/p&gt;
&lt;p&gt;Check out the manual there as there’s plenty of things you can do. I
would at least install the fonts they recommend and see how you like
them.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="annoying-windows-alert-sound"&gt;
&lt;h2&gt;Annoying Windows Alert Sound&lt;/h2&gt;
&lt;p&gt;I found my Windows was making that terrible &lt;em&gt;du-da-duuunn&lt;/em&gt; sound every
time I double tabbed in the new shell. I figured I probably don’t want
the terminal to play sounds, so I just opened the “volume mixer” in
Windows and muted the console window.&lt;/p&gt;
&lt;/div&gt;
&lt;div class="section" id="wrapping-up-and-next-steps"&gt;
&lt;h2&gt;Wrapping Up and Next Steps&lt;/h2&gt;
&lt;p&gt;Turns out &lt;strong&gt;there’s a lot of customization available.&lt;/strong&gt; Definitely look
into different plugins and try using the ones you think you’ll be using
a lot. And I encourage you to get creative with your
&lt;a class="reference external" href="https://codeburst.io/7-super-useful-aliases-to-make-your-development-life-easier-fef1ee7f9b73"&gt;aliases&lt;/a&gt;
as well.&lt;/p&gt;
&lt;/div&gt;
</content><category term="windows"/><category term="command-prompt"/><category term="shell"/><category term="terminal"/><category term="windows"/><category term="windows-subsystem-for-linux"/><category term="z-shell"/><category term="zsh"/></entry></feed>