# Compiling on the Windows 2012 VM

**URL:** https://discuss.elastic.co/t/compiling-on-the-windows-2012-vm/56380
**Category:** Beats
**Tags:** packetbeat
**Created:** [July 26, 2016, 10:09am UTC](https://discuss.elastic.co/t/compiling-on-the-windows-2012-vm/56380 "2016-07-26T10:09:47Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![lonangel](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@lonangel](https://discuss.elastic.co/u/lonangel)
#### Post date: [July 26, 2016, 10:09am UTC](https://discuss.elastic.co/t/compiling-on-the-windows-2012-vm/56380/1 "2016-07-26T10:09:47Z")

</div>

Hi, I've been trying to compile and run the packetbeat source on the win2012 vm that is on the repository but I can't seem to get it right. It compiles ok with the _ **go build** _ command but when I try to run **packetbeat.exe -devices** I get the following exception.

`PS C:\dev\LogStack\beats\packetbeat> .\packetbeat.exe -devices Exception 0xc0000005 0x0 0x2781566 0x10f7c98 PC=0x10f7c98 signal arrived during external code execution github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap._Cfunc_pcap_findalldevs(0xc082028038,0x19b7160, 0x0) ??:0 +0x3c github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap.FindAllDevs(0x0, 0x0, 0x0, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/vendor/github.com/tsg/gopacket/pcap/pcap.go:518 +0xf1 github.com/elastic/beats/packetbeat/sniffer.ListDeviceNames(0xc083233201, 0x0, 0x0, 0x0, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/packetbeat/sniffer/sniffer.go:79 +0x7c github.com/elastic/beats/packetbeat/beater.init.1.func1(0xc08247c780, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/packetbeat/beater/devices.go:21 +0x6c github.com/elastic/beats/libbeat/beat.FlagsHandlerCallback.HandleFlags(0xc082f0fc30, 0xc08247c780, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/libbeat/beat/flags.go:35 +0x39 github.com/elastic/beats/libbeat/beat.handleFlags(0xc08247c780, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/libbeat/beat/flags.go:26 +0xb5 github.com/elastic/beats/libbeat/beat.(*Beat).handleFlags(0xc08247c780, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/libbeat/beat/beat.go:230 +0x4ca github.com/elastic/beats/libbeat/beat.(*Beat).launch(0xc08247c780, 0xe2fef8, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/libbeat/beat/beat.go:150 +0x4c github.com/elastic/beats/libbeat/beat.Run(0xce4ca0, 0xa, 0x0, 0x0, 0xe2fef8, 0x0, 0x0) C:/Gopath/src/github.com/elastic/beats/libbeat/beat/beat.go:133 +0x6e main.main() C:/Gopath/src/github.com/elastic/beats/packetbeat/main.go:26 +0x4e`

I'm compiling and running inside the VM.

---

<div class="post-metadata">

### Author: ![ruflin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ruflin/32/3116_2.png) [@ruflin](https://discuss.elastic.co/u/ruflin)
#### Post date: [July 26, 2016, 12:46pm UTC](https://discuss.elastic.co/t/compiling-on-the-windows-2012-vm/56380/2 "2016-07-26T12:46:27Z")

</div>

Which golang version did you use?

---

<div class="post-metadata">

### Author: ![lonangel](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@lonangel](https://discuss.elastic.co/u/lonangel)
#### Post date: [July 26, 2016, 1:29pm UTC](https://discuss.elastic.co/t/compiling-on-the-windows-2012-vm/56380/3 "2016-07-26T13:29:45Z")

</div>

I'm using the one in the VM, I think is 1.5.3.

---

<div class="post-metadata">

### Author: ![andrewkroh](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/andrewkroh/32/3784_2.png) [@andrewkroh](https://discuss.elastic.co/u/andrewkroh)
#### Post date: [July 26, 2016, 1:39pm UTC](https://discuss.elastic.co/t/compiling-on-the-windows-2012-vm/56380/4 "2016-07-26T13:39:50Z")

</div>

I think there is an issue with the winpcap developer pack. IIRC, it only contains a 32-bit lib. We had to perform some [workarounds](https://github.com/elastic/beats/issues/1259) to build it for 64-bit. So if you `set GOARCH=386` before running `go build` it might work. This will build a 32-bit binary.

---

<div class="post-metadata">

### Author: ![lonangel](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@lonangel](https://discuss.elastic.co/u/lonangel)
#### Post date: [July 27, 2016, 9:26am UTC](https://discuss.elastic.co/t/compiling-on-the-windows-2012-vm/56380/5 "2016-07-27T09:26:52Z")

</div>

Hi,  
Thanks for the fast reply.

Will try later today and post back the results.

---

<div class="post-metadata">

### Author: ![lonangel](https://avatars.discourse-cdn.com/v4/letter/l/59ef9b/32.png) [@lonangel](https://discuss.elastic.co/u/lonangel)
#### Post date: [August 1, 2016, 1:16pm UTC](https://discuss.elastic.co/t/compiling-on-the-windows-2012-vm/56380/6 "2016-08-01T13:16:15Z")

</div>

It is working now, following the work around.

Thanks

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [August 16, 2016, 10:09am UTC](https://discuss.elastic.co/t/compiling-on-the-windows-2012-vm/56380/7 "2016-08-16T10:09:57Z")

</div>

This topic was automatically closed after 21 days. New replies are no longer allowed.
