Back again, as promised (albeit a week later than planned). Today I’ll be setting up a Windows 7 host on UNetLab. I did try Windows 10, but it failed to launch after the conversion to qemu.
If you want to play along at home, you’ll need a Windows 7 VM running under VirtualBox, UNL (UNetLab) and a bit of time.
The first step is to convert the VirtualBox image’s VDI file into RAW:
Stuarts-iMac:VirtualBox VMs stu$ cd Windows 7-Pro/ Stuarts-iMac:Windows 7-Pro stu$ ls Logs Windows 7-Pro.vbox Windows 7-Pro.vbox-prev Windows 7-Pro.vdi Stuarts-iMac:Windows 7-Pro stu$ vboxmanage clonehd Windows 7-Pro.vdi Win7.img --format RAW 0%...10%...20%...30%...40%...50%...60%...70%...80%...90%...100% Clone hard disk created in format 'RAW'. UUID: a1c6a37c-8988-49a0-b20e-aca2fb22f181 Stuarts-iMac:Windows 7-Pro stu$
Then using Filezilla, or similar, copy it to the /tmp folder on the UNL VM. If you start to run out of space, as I just have, then read Andrea’s guide on adding more space to UNetLab.
root@unl01:~# cd /tmp/ root@unl01:/tmp# ls vmware-root Win7.img root@unl01:/tmp# mkdir /opt/unetlab/addons/qemu/win-7-Pro root@unl01:/tmp# /opt/qemu/bin/qemu-img convert -O qcow2 -f raw Win7.img hda.qcow2 root@unl01:/tmp# mv hda.qcow2 /opt/unetlab/addons/qemu/win-7-Pro/ root@unl01:/tmp# ls /opt/unetlab/addons/qemu/win-7-Pro/ hda.qcow2 root@unl01:/tmp# /opt/unetlab/wrappers/unl_wrapper -a fixpermissions root@unl01:/tmp#
Now we can make a nice looking topology:
I am using Chicken of the VNC, it seems to work much better than the Mac in-built one. Means connecting is a little bit more manual, but it works well.
Configuration and testing
So now let’s do some basic configuration.
I am not testing end-to-end connectivity at this stage, that’s for a different post, we are just testing very basic host-to-switch connectivity.
The VLAN 11 interface on the switch is given the IP address of 10.1.11.1 and set I have an IP address on the Windows host of 10.1.11.10, both are using a /24 subnet. The Windows host also has the switch IP address set as it’s default gateway:
>
Awesome, we can ping between them.
See how easy it is to get a Windows 7 host running in UNetLab?
Stuard, after when we got hda.qcow2 how could we add windows mashion in our lab? When i press Action -> add node -> Windows i don see any image
Nice Post! 🙂 How are the memory and cpu footprint on UNL when running this inside?
Cheers! So far all is good on the CPU front – but check out my new server build post: https://www.802101.com/security-lab-server-build/ – I'll be spinning up more of the security nodes tomorrow and will report back how its handling everything. If you want a good comparison between UNL and VIRL – then check out this twitter link: https://twitter.com/aitaseller/status/629559242844934144 – UNL absolutely spanked VIRL!
I followed your steps and everything were ok .. but after adding the PC and press on start i can see in the right of the screen " Node(s) started, please wait." and no errors messages appear but the machine didn't work .. it still in stopped state !!
do other nodes work ok? You might want to make a forum post (see menu link) for this as the UNetLab guys might be able to help
Hello Stuard. Thank you for you great post. I have a problem with Windows node. Lets go step by step.
Firtly to say, I tried downloaded Windows vmdk and vhd files from internet and also I tried my own vm machines.
1)I created win-7-Pro directory, like you.
2)I copied it to unetlab with WinSCP, then converted it to qcow2 format as you mentioned. But I converted directly form vhd and vmdk files, not .img file like you.
3) then moved it to win-7-Pro directory.
4) I did wrapper fixpermission command, like you.
5) Finally I was able to add Windows image to the topology.
But it didnt boot up. In black screen, it says, no network and bootable devices found.
Please, help me.
Hi Stuart,
Do you know if it's working with win 7 only or win8 can be loaded too ?
Cheers
I know that Windows 10 just does a boot loop, and never seems to recover, not tried 8.1.
Hi Stuart,
after all the assembly made a start, but a blue screen of death.
What could be the problem? Broken image?
Did anyone resolve this problem?
I also runned into problem that there is no image regardless how I try to add it.
can you outline all the steps you went through? Is the folder named correctly?
Hello Stuart, Its seems that I can get the VM to start, but I cannot access it via VNC, is there any tips you could provide?
Need more info, like what VNC client you have installed, if you hover over the node, does it show the vnc:// url, what happens when you try…
I followed the steps but dead blue screen is all I'm getting.
Even safe-mode fails to get in.
Tested the virtual box copy again as it is working fine.
Great progress but something is missing.
Will try to play bit with it later
I hit a number of headaches trying to import it directly. Today I threw my hands up lol, the windows 7 iso directly in my win-7/ dir in UNL. After naming it cdrom.iso, Works like a charm, just needed an empty hda.qcow2 also. I'll give it a go with Windows 2012 later today *fingers crossed*
So Server 2012 works just fine. Got it installed and running now. Again, just need cdrom.iso (windows server 2012 iso) and an empty hda.qcow2.
Thanks Jon. I did try Win 10, but it bluescreened on me constantly.
It is the same for Window XP? I mean … the same name the folder?
The folder needs to be named win- something, so you could have win-7 and win-xp but each needs to be separate
The folder needs to be named win- something, so you could have win-7 and win-xp but each needs to be separate, so one folder per image
Lots of Thanks, I try various days and not working, now i rename folder to win-7 and win-xp working now, very happy.
I followed your steps and everything were ok .. but after adding the PC and press on start i can see in the right of the screen ” Node(s) started, please wait.” and no errors messages appear but the machine didn’t work .. it still in stopped state !!
Hi hk,
did you solve your problem? I’m with the same problem.