Expanding The Size of a Hyper-V Virtual Disk

Introduction

There are tasks that we all do, but rarely. It’s helpful to have a reference to go back to.

Expanding the size of a Virtual Hard Disk, or VHDX file, is one of those. I use Hyper-V quite a bit to create virtual machines for testing, development, and the like. Every so often though I’ll underestimate the amount of space I’ll need for a machine.

As it turns out expanding the drive size isn’t terribly difficult, but there’s quite a few steps involved. This post will server as a reminder to myself, and hopefully guide others, in expanding the size of a VM drive.

I’ll break this into two parts. In the first half, we’ll see how to expand the drive within Hyper-V. This will expand the VHDX file to a new larger size.

In the second half, we’ll go into the Windows running in the VM to tell it to use the newly expanded space.

Expanding the Drive in Hyper-V

Begin by opening Hyper-V. In the Hyper-V manager, click on Edit Disk in the Actions.

This will open the Edit Virtual Hard Disk Wizard.

If this is the first time you’ve run the wizard, you’ll see a welcoming screen. If you see this, I’d suggest clicking on “Do not show this page again” and clicking Next.

Now use the Browse… button to locate the VHDX file you wish to modify. Once you’ve done that, click Next.

Now we’ll select the action, in this case we’ll pick the Expand option and click Next.

Now we’ll enter a new size for the drive. It shows the current size as 250 GB, so I’ve entered 500 so I can double the size. Obviously you’ll enter a size appropriate to your needs.

Once done, click Next.

On the final page of the wizard it shows what is about to happen. It lists the name of the VHDX file we’re working on, what the action is (Expand), and what the size will be of the new drive.

Just click Finish and the VHDX file will be updated.

Accessing The Expanded Space in Windows

In this example we’ll be using Windows 10 inside our Virtual Machine. Go ahead and start, then connect to your Windows 10 Virtual Machine.

If you go into File Explorer you’ll see something interesting.

Even though we expanded the VHDX to 500 GB, our virtual machine still thinks the C drive is 249 GB.

What we need to do is expand the already existing drive into the newly allocated space.

In the Windows 10 menu, go down to Windows Administrative Tools, then pick Computer Management.

The Computer Management window has a tree on the left. If the Storage tree is not expanded, do so and click on the Disk Management branch.

In the screen capture above, you can see the orange arrow is pointing to the existing C drive area. To the right of that a green arrow points to the newly added but still unallocated space.

Right click in the C: drive area, and in the menu that appears select Extend Volume…

The Extend Volume Wizard now appears, just click Next to proceed past the welcome screen.

By default the wizard will put the only unallocated partition in the selected area, but if you have more than one unallocated partition you can select a different one.

At the bottom, the “Total volume size will” show the total amount of space on the new drive, once the unallocated space has been added.

The next line shows the maximum space in the unallocated partition.

The final line allows you to select the total amount of space to pull from the unallocated area. By default it is set to the max space in the unallocated area, but if for some reason you want to save some of that you can lower the amount.

In this case I’ll take the default options and click Next.

You’ve now reached the final screen of the wizard, just click Finish to have it do its work.

The Computer Management window now shows the expanded C drive. You can now close the Computer Management window.

If you go back to the File Explorer and refresh it, your C drive will now show the new size.

Conclusion

In this article, we expanded the size of a Hyper-V virtual hard disk (VHDX) that hosted a Windows 10 installation. As you saw, it was pretty simple to do, but did require a few steps.

Hopefully you’ll find this useful in working with your Hyper-V machines.

Working From Home – Permanently

Introduction

When the current COVID crisis hit, there were a lot of posts and questions about working from home. But of late I’m seeing an interesting trend of posts on social media from people who have been working from home, but were just told they’ll be working from home permanently. They will never return to the office, at least that of their current employer.

These folks have been “getting by” with temporary setups. Using a laptop on the kitchen table, or on a desk in the corner of the bedroom. Now that they’ve been told this will be a permanent situation, they are looking for suggestions and advice on how to setup a permanent home work area.

As someone who has worked from home for the majority of the last decade, I thought I’d share a few tips and tricks. Granted some of these may seem obvious, but since the questions are being asked I’m hopeful at least one or two of my suggestions may help the new breed of work-from-home people.

Some of these suggestions involve tech, but some also involve your daily workflow. Let’s get started!

Multiple Monitors

One of the best things you can do is have more than one monitor. Now granted, I went a bit over the top having a rack with six monitors, as you can see above.

In my case I do a lot of video recording and editing for all of my Pluralsight courses. In the big 32 inch monitor at the bottom center I hold the content I’m recording. In the lower right I put my notes that pertain to what I’m recording. The left side gets my recording software.

In the upper left I put my audio editing software. Upper right gets my web browser so I can quickly look things up that may arise as I record. Finally the upper middle is for miscellaneous stuff.

Having six monitors has increased my workflow as I don’t have to cycle through applications, everything is right there where I can see it.

I admit, most people don’t need this setup. However I would suggest at least two monitors, or even better three, as an ideal work setup.

If your main machine is a laptop you should have at least one external monitor port. You can get more through either an external GPU box (if your laptop supports it) or one of the many USB-to-Video adapters on the market.

Most monitors support multiple inputs, and you can use buttons on the monitor to swap between inputs (in my case, multiple laptops).

As an alternative to multiple monitors, I’m also seeing people using a 4K TV. The 4K resolution amounts to having four 1920×1080 monitors in a square. Using software like the Windows PowerToys you can easily snap an application to one of the four areas, or you can use the full area when you want to.

Racking Your Laptops

I use multiple laptops, as I work in multiple environments. I have a Lenovo P51 on the bottom, in the middle is my Apple MacBook. On top is another Lenovo that I am running Linux Kubuntu KDE Neon on.

My laptops are stacked on a wire shelf that I got from my local big box store. I like the wire rack as it helps with air flow around the computers.

I really like these shelves, they are affordable, easy to configure, and hold a lot of weight. My home office doubles as my “ham shack” (amateur radio), here’s a shot of the back wall and a little bit of the side.

The wire racks on the back wall hold my antique radios as well as some of my “antique” or classic computers like my Commodore 128 or the older “egg bowl” Mac. To the right of the Mac are my modern ham radios.

I use zip ties to hold each tower together so it winds up being a solid unit. Just be sure to have good, sturdy tables that hold a lot of weight.

Get A Good Keyboard

You are on your computer all day, and most laptop keyboards are not that great. (Although I do love the keyboard on my Lenovo P51). Using a bad keyboard can lead to many health issues with your hands. In addition, if you have multiple monitors using an external keyboard makes it much easier.

This keyboard is part of the Logitech line which (although it’s a bit hard to tell from my mediocre pic) does have a slight curve to it making it more ergonomic.

The big thing for me is the ability to Bluetooth connect it to multiple computers. This is connected to the three laptops you saw in a previous pic. I can just use the 1, 2, and 3 keys to quickly swap between computers (I use the buttons on the monitors buttons to swap inputs between the three laptops).

As someone who has suffered from hand issues, I find a regular mouse painful to use after a while. For years I’ve been a fan of the Logitech trackballs. I was amazed at how quickly I became used to them.

Pictured is a Logitech MX Ergo, which unfortunately can only pair to two computers so I have another older model trackball for use with the third machine.

You may wonder about the scrap of a yellow post it note over two of the keys. I work in PowerShell within VSCode a lot, and frequently use the F5 and F8 keys. I’m also one of those people who likes to work with the lights on very low, and with my old eyes distinguishing between the function keys can be difficult.

Using the little scrap of post it notes can make it easy for me to find my often used F5/F8 keys.

Use A Good Headset

Do you participate in online calls (Zoom, Skype, etc.) all day? Then for crying out loud, get a good headset!

It drives me nuts to be in meetings with people who use the built in mic and speakers on their laptop. These are NOT quality, and often sound like the person is in the bottom of a barrel. A very echo-ey barrel.

The wired earbuds some people use are a little better, but not by much. The microphone is tiny and comes across as very “tinny” for lack of a better word.

My headset of choice is the HyperX Cloud Stinger Core Wireless. You can get them from both Best Buy and Amazon, for about $80 (US currency). They have two big advantages over other headsets.

First, they are wireless. Drives me nuts to have a wire I can easily get tangled up in. Plus, and I admit this is a duh moment, I’ve stood up multiple times with the old wired headsets forgetting about the wire and jerking the headset off my head.

Second, and more important, is the muting. To mute my microphone, all I have to do is lift the boom up. That’s it, no having to fumble for a button on the headset. Just lift it up, it’s muted, lower it back down and people can hear me. It makes calls so much easier, I can hear people clearly, and they have clear audio of me.

They are so good I use them on a weekly Minecraft stream my friend Marc runs on YouTube. (I participate as ArcaneMining).

I will add, for recording my Pluralsight videos I use a Yeti podcaster microphone on a large boom arm. It gives excellent quality, however that is very much overkill (unless of course you are also recording Pluralsight videos).

Trust me, you will have a much better experience and the people you meet with will thank you. Plus they are at a price point that makes them affordable to most people.

Along with the headset also consider an external camera. While most laptop cameras are decent, I really get tired of looking up people’s noses during a call. You can place it on top of your external monitor for a much better view.

I’m fond of my Logitech C922, runs about $100 on Amazon, but there are many similar cameras of good quality.

Isolate Yourself

Now we’ll shift from tech to workflow related items. The first of these is to isolate yourself.

If you live alone this is easy, but if you have a bunch of people in your house it can be important to find a place you can isolate and have quiet time to think. Put your home office in a place where you can close the door, and make it understood when the door is closed to consider it a “do not disturb” sign.

I can understand there will be situations where you can’t isolate all day. But try to find set times where it’s clear to others in your household that you should be left alone. When the door is open, they are free to come in.

Not only will this make you more productive, but it will avoid embarrassing situations like a kid running through the background of a Zoom call in only their underwear.

Move

It’s important you take breaks through the day to move. To get up from your desk and walk around. I know personally I will get so focused on what I’m doing that time flies by, then I realize three hours have flown by without me moving from my chair. When I finally stand up, well my creaky old man body reminds me.

Use some kind of app or device to remind you on a regular basis to move. My Apple Watch will buzz every hour reminding me to stand up, and will even track how often I actually do it.

There are also apps for the various brands of smart phones, plus I’d imagine many freeware apps for your computer. If nothing else get a good old fashioned timer from the kitchen section of your favorite big box store.

Another advantage to the wireless headphones I mentioned earlier in this post is the ability to get up and move during an audio call.

Have Laptop Will Travel

An advantage of having a laptop for your main computer is it’s (surprise) portable!

Finding time to work at alternate locations can help keep work enjoyable. Perhaps once a week, take your laptop down to your local coffee shop (assuming it’s open), sit and work there with a cup of coffee for a bit. (Hint, good earbuds and music on your phone can help drown out the other noisy patrons.)

Go outside! I often carry my laptop onto my back porch to enjoy fresh air and sunshine while I work. There’s also a nice park nearby, I sometimes work from there using my phone as a Wi-Fi hotspot.

Don’t think you need to stay all day. Sometimes just two or three hours can be energizing and very productive.

Of course this assumes you aren’t doing a meeting, but most of us have time in the day or week with no meetings scheduled.

And because you are the go doesn’t mean you have to give up multiple monitors. If you have an iPad, and a modern MacBook the sidecar feature will let you use the iPad as a second monitor.

If you are on Windows, or an older MacBook, there is a nice piece of software called Duet Display that will let you connect your iPad to your computer (via the USB cable) and use it as an external monitor.

If your tablet is Android based, Splashtop offers a free piece of software called Wired XDisplay for both Windows and Mac that enables your Android tablet as an external display.

Set Boundaries

Of all the pieces of advice I can offer, this by far is the most important.

First, set boundaries with others in your household. Make it clear when you are working from home, you are WORKING. Just because you are at the house doesn’t mean you can “go ahead and do some laundry”, cut the grass, dust, make dinner, or any of the other typical household chores.

This goes for you, as well. When you work, focus on your work. When you are not working is the time for the other chores.

It’s also important to set boundaries with coworkers. Make sure they understand when you are available for meetings and when you shouldn’t be disturbed. Use your company work calendar to indicate when you are available for meetings.

They also need to understand you can’t just hop up on a moments notice to come into the office for “a quick meeting”.

Don’t be afraid to say NO! Push back for phone / online meetings. I used to work for a company that let us work from home two days a week. Even though I had it on my work calendar I was constantly having project managers schedule two hour “in person” meetings on my work from home days.

I finally started pushing back, saying I wouldn’t be in the office that day but give me a conference call line and I’d be on the call. Of course they’d say “we really want you here”.

I’d then ask “what value is provided from me being there versus on the phone”? “How will the meeting be different or less productive if I’m on a call?”

If they couldn’t provide a good answer, a really good answer, I’d tell them I’ll be there on the phone call talk to ya then. (Of course I also had a great boss who supported me, you may not be so lucky.)

Finally, set boundaries with your time. Designate the hours you will work each day. When you are working, make it clear to your family you aren’t available to do household tasks.

When it’s outside work hours, make it clear to your coworkers you are off. It is far too easy to wind up working far more hours than you normally would when working in an office. When (for example) 5 pm hits get up and walk away from your computer, and don’t go back until the next morning.

Conclusion

In this post I’ve shared some tips for people who are moving to a work from home situation based on my years of experience doing just that. I really love working from home, and I think you will as well if you setup a comfortable environment, with the right equipment, and having set boundaries with your family and co-workers.

Formatting A Drive as exFAT on Windows, macOS and Linux

Introduction

In my previous blog post, Sharing a Drive Between Windows, macOS and Linux, I described how to setup the three operating systems to read a drive that had been formatted as exFAT. The exFAT format is readable by all three, and making it easy to share files between different operating systems.

A natural question that follows is, “how do I format a drive as exFAT?”

In this article I’ll show how to format an external drive as exFAT. I’ll be using an 8gb thumb drive, but I’ve used this technique with both thumb drives as well as the larger external multi-terabyte hard drives.

Windows

Windows is the easiest of the three to format a drive for exFAT. First, insert the drive into a USB port. This will typically open the Windows File Explorer, but if not, open it.

Now right click on the drive letter for the USB drive, and click on Format. The format dialog will appear.

In the second drop down you can pick the file system. Use it to select exFAT. You can also enter a new volume label if you want. Simply click the Start button to kick off the format process.

You will of course get a warning that all the data on the drive will be lost, simply click on OK to proceed.

Once done Windows will let you know. Just click OK and your drive is ready to use.

Apple macOS

There’s a few more steps to formatting a drive to exFAT in macOS, but it’s still pretty simple. Start by opening Finder, then go to the Applications. In Applications, open the Utilities folder.

Inside the Utilities, launch the Disk Utility. If you’ve not done so, connect the USB drive you want to format as exFAT.

On the left side of the Disk Utility is a list of drives, click on the USB drive in the list.

Above the drive info area are a series of command buttons. Click on the Erase button. Note you need to click on the icon, not the Erase label.

In the dialog that appears, you can change the label if you wish. The important box is the Format one. You can use the blue arrow to bring up the list, and change it to exFAT.

Once exFAT is selected, you can click the Erase button on the lower right.

Once done, macOS will let you know. Just click Done, and the drive will be ready for you to use.

I’ve used this technique with macOS versions from High Sierra onward.

Linux

For this section, I’m using screen shots from my Kubuntu 20.10 computer. The techniques will work with most Ubuntu/Debian based installs. To make it more portable to other versions, we’ll do most of it using the command line.

Note, these instructions assume you’ve already followed the instructions in my previous blog post, and installed the exFAT utilities.

Start by opening up a terminal window, and entering the following command:

df

Your output will look something like this:

Filesystem     1K-blocks     Used Available Use% Mounted on
tmpfs             805596     1752    803844   1% /run
/dev/sda2      244568380 18388480 213686844   8% /
tmpfs            4027972      128   4027844   1% /dev/shm
tmpfs               5120        4      5116   1% /run/lock
tmpfs               4096        0      4096   0% /sys/fs/cgroup
/dev/sda1         523248     7984    515264   2% /boot/efi
tmpfs             805592      108    805484   1% /run/user/1000
/dev/sdb1        7815648       96   7815552   1% /media/arcanecode/4ECB-E340

For this exercise, I’ll be using the /dev/sdb1 drive which is my 8gb thumb drive.

Before we can proceed, we’ll have to unmount the drive. The command is simple.

sudo umount /dev/sdb1

Now that the drive has been unmounted, we can format it using the mkfs utility.

sudo mkfs.exfat /dev/sdb1

Once formatting is complete, we can check its status using the fsck command.

sudo fsck /dev/sdb1

Your output will vary depending on the drive you formatted, but it will resemble something like this:

fsck from util-linux 2.36
exfatfsck 1.3.0
Checking file system on /dev/sdb1.
File system version           1.0
Sector size                 512 bytes
Cluster size                 32 KB
Volume size                7633 MB
Used space                 3041 KB
Available space            7631 MB
Totally 1 directories and 3 files.
File system checking finished. No errors found.

A benefit of using fsck is that will also remount the drive for you, making it ready to use.

You can verify it again using your systems file explorer. Here I’m using Dolphin, the explorer built into Kubuntu.

Navigate to the drive, right click on it, and pick Properties.

In the properties window it will show you the file system. As you can see, it has been formatted to exFAT.

Conclusion

In this post we saw how to format a drive for exFAT on three operating systems. You can now format a drive using any of the OS’s, and be able to use it across all of them.

Sharing a Drive Between Windows, macOS and Linux

I have a lot of computers, on which I use a variety of operating systems. Some run Windows 10, my Apple macBooks all run macOS, and on others I have a variety of Linux distros, primarily Ubuntu based.

I would like the ability to share external drives, such as thumb drives or external SSD drives, between them. To get that compatibility across OS’s, I need to format those drives in a file format called exFAT.

exFAT is a replacement for the older FAT32, but has the benefits of other file systems such as NTFS. I can have long file names, and store files bigger than four gigabytes in size to name a few.

Windows and macOS both support exFAT out of the box. I can just plug in an exFAT drive into them, and both will let me read and write to them. (Note that not all drives come formatted as exFAT, you may need to reformat them to the exFAT system). Linux, however is another story.

To allow Linux to read an exFAT drive you need to install the exfat-utils utility. On Ubuntu based distros it’s pretty easy, just open up a terminal and enter the following command, all on one line.

sudo apt-get install exfat-fuse exfat-utils

For other distros you can use their native installer, such as yum, to install the exfat-utils. After that you can simply plug an exFAT thumb drive or SSD into your Linux box and it will know how to read and write to the drive.

Tips for the Disorganized Laptop Traveler

Introduction

I realize with the current (as of the time I write this) COVID lockdown, people aren’t doing a lot of traveling. But things are beginning to open back up, and will continue to do so as the year progresses.

In a former job I traveled a LOT. In addition I frequented user groups and conferences, giving presentations. Over time I’ve picked up a few handy, and inexpensive tips and tricks for keeping your laptop bag organized. So I thought I’d do a bit something different with this post and share some of these tips with you.

Keeping It Together

I have a lot of laptops, I admit I’m a bit of a gear nerd. Most folks though, have at least one, along with a tablet of some type, plus various accessories. How do you keep the power supplies plus all the associated cords neat and together?

I use pencil bags available in my local big box store in the school supply area.

These bags are inexpensive, typically around $3, come in a variety of colors, and hold a lot. Each laptop I have has a bag associated with it, which holds the power supply plus any extra cables I use with it.

As you can see, this is the (after market) power brick for my Dell Inspiron, along with two USB cables (one Apple and one Micro-USB) that I often need with that computer. When I’m ready to go somewhere, I just reach into a box and grab the bag for the laptop I’m taking with me.

In addition, we all seem to have lots of spare cables. I’ve used these bags to organize my cables, one for Micro-USB, another for USB-C, and so on.

What’s In The Bag?

So how do I remember what’s in each bag? Well at first I bought the book “How To Be a Psychic for Fun and Profit”, so I could use my magical abilities to just discern what was in each pouch. But the book didn’t make much sense, until I realized what’d I had actually bought was “How to Be Psychotic for Fun and Profit”. So I abandoned that and went with an alternate solution.

I purchased small tags, these are typically sold as tags for keys. You’ll find them in the office supply section of stores. On each tag I write what’s in the bag, making it easy to identify.

They are inexpensive, so if I decide to reuse a bag for something else I can take off the tag, throw it away and put on a new one. They can also be used to identify other devices.

Here I’ve attached one to each of my USB keys, to let me quickly identify the size. For other keys in my collection I might also write down what’s on there, for example “Backup for XYZ Project”.

It Just Needs More Power

One of the first things I do after I get a new laptop is hop on Amazon or swing by my used computer store and purchase spare power supplies for my laptop. This lets me keep one on my desk, one in a bag, and sometimes I’ll get one more to put by my recliner.

When I get a power supply, I use a Sharpie to write which laptop the power supply goes with.

Now I don’t have to think about which laptop this supply goes with.

It’s gotten a bit easier these days as many laptops are now powered with USB-C. This makes it much easier to share supplies. Earlier I showed the power supply I travel with for my Dell Inspiron. I actually have two of these, one for my Dell, and a second for my 2017 Apple MacBook.

This model provides 87 Watts to the laptop, plenty to power not just the laptop but any accessories I want to plug into the laptop like a USB monitor, hard drives, and the like.

In addition this power supply also has four USB A ports which I can use to recharge my iPads, Android tablets, iPhone, etc. This is especially nice in places like coffee shops or hotels where plugs may be limited.

Power To The People

Another thing I do to help address the problem of limited plugs is carry a small extension cord.

These are two I had handy. One is setup for devices with three prongs, the other two, I pick the one to use depending on what equipment I’m bringing with me.

Both are 9 feet long, which may seem a bit excessive but I have learned from experience wall plugs are not always where they are convenient. I can’t tell you the number of hotel rooms I’ve been in where the desk was no where close to the plug.

There may also be competition for an available plug. The small coffee shop I frequent has very few plugs. I’ve found I can make new friends by using an extension cord and offering to share it.

Hold It Together

In order to manage the mess of wires that accompanies any electronic device, I use Velcro cable ties.

These things are great. EVERY cord that comes into my house gets one. As you would expect, all my cables, laptop power cords, etc get these.

But I also put them on the power cords for my TV, lamps, power tools, fans, all my ham radio gear, you name it if it’s a cord it gets one of these straps.

Rising to the Occasion

Hand issues seem to run rampant in the tech community, being on a keyboard all day can take a toll. Something you can do to help your hands is get a laptop riser.

These are two different types I have, but there are many others you can pick from. On the left is a pair of wedges, they seem similar to door stops. They are nice because you can spread them out for any size laptop, and raise the laptop to different heights.

On the right is a riser that folds up nice and small, but the legs can extend out for whatever size you want. The L shapes on the front (closest to the lower edge of the photo) keep the laptop from sliding off. Note, if you have an extremely thin laptop your wrists may brush against the tops of the Ls.

Either way, it can raise your keyboard up and make it much more comfortable and ergonomic for typing, especially for long periods of time.

Which End is Up?

Cables ends like USB-C or Apple’s lightning are a real blessing as you don’t have to figure out which end is up. Micro-USB however, is another story.

As I’m sure you are aware, Micro-USB has one edge longer than the other. As I’ve aged, with my poor old eyes it can be hard for me to tell which side is the longer one, especially in dim light. I’ve come up with a simple solution though.

I’ve taken a silver Sharpie marker, and drawn a line on the side of the cable that corresponds to the long side of the connector. For white cables, I use a black Sharpie.

For the devices I plug into, I draw a corresponding line where the long side plugs into.

Here you can see I’ve drawn a black line by the port where the long side of the Micro-USB goes. This makes it extremely easy to plug my Micro-USB cables into the various devices I use, I just align the two lines and away I go, quick and easy.

You could also decide to draw the line on the short side of the Micro-USB connector, rather than the long side. Just be consistent once you make the choice.

In addition to silver and black, I’ve found the orange and red Sharpie markers work pretty well too.

I’m a Big Fan

One last piece of gear I keep in my bag is a small fan.

This fan has a battery and can be recharged over Micro-USB. As a matter of fact the previous photo is the back of this fan.

I can’t tell you how many stuffy conference rooms I’ve been stuck in. At my local coffee shop, sometimes sitting in front of the window can get really hot when the afternoon sun starts coming in. Even a small fan like this can make a huge difference.

This fan is small, about the size of my hand (although I admit I’ve got big hands). I like this model, it has three speeds and can run even when the battery is being recharged.

These fans come in a variety of sizes, shapes, and prices, so pick one that fits your budget and laptop bag.

Conclusion

In this article I’ve laid out a few tips that I hope will make your life a bit easier, and help get your tech gear organized.

If you have tips and tricks you want to share do so in the comments below, or let me know if you’d like to see more blog posts like these.