Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Visual C++ for Linux Development (msdn.microsoft.com)
271 points by taspeotis on March 30, 2016 | hide | past | favorite | 93 comments


Works pretty well, had a minimal X11 + GL app up and running in minutes.

Issue 1: Visual Studio doesn't pull header files from the target Linux system so Intellisense was useless.

Issue 2: Every time I compiled something or started a debug session, four new sshd processes and a new sftp-server process would start on the target Linux system (Ubuntu 14.04 running in a VM). Eventually I had 16-20 of these processes running and they never exit.


1) this is something we're planning on making much better with automatic acquisition of the headers from the remote for IntelliSense 2) I think this might be a cleanup issue, I will fix this


Any plans to use your new linuxulator to locally deploy and develop linux binaries?


How exactly does the x11 part work. If I'm working remotely and have XServer running on windows, will it show the program when I hit run?

Or do I need to be logged in through a terminal session separately running the executables through that?


How exactly does the x11 part work.

We've been asking that question for literally decades.


I've not tried anything with XServer on windows. What we showed in the blog post is setting export DISPLAY=:0.0 to the Pre-Launch command in the project properties. Then when the gui app gets launched from our session it pops open on the remote Linux desktop.


Hmm, I guess I would use a terminal then. I do C++ programming a lot on linux clusters for science. Being able to launch X11 compiled applications remotely would be great. I currently do this using netbeans on windows.


Interesting, give it a try and let me know how it goes. I'd love to talk to you more about your workflow here. Very interesting.


I don't know, but perhaps you could ssh -X and echo "$DISPLAY", then try to export that value instead.


Why are they spinning up new sshd instances? That makes me raise an eyebrow.


The 'sshd' process on the target Linux apparently forks a process to handle each connection . . . with two SSH sessions the Linux target looks like this (pstree -p):

        |-sshd(1017)-+-sshd(5495)---sshd(5561)---bash(5562)
        |            `-sshd(5595)---sshd(5631)---bash(5632)
When the ssh sessions die, only process 1017 is left.


sshd forks per connection.


For me, the full-measure solution would be to provide a native port of Visual Studio for Linux. I understand that this is not practical on many, many levels, but if Microsoft were to ever take on that herculean effort they would win me over in terms of my choice for dev tools under Linux.

For now I'll have my Windows stuff in Windows and my Linux stuff in my Linux partition. I do look forward to checking out the linux-in-windows (dynamic syscall translation) feature soon though.


That would involve a full ground-up Visual Studio rewrite. It's not going to happen.


No, but Visual Studio Code is off to a very good start, and it runs well on Windows, Mac, and Linux, all free and open source. It's not a "rewrite" per se, but a new product with the same name but targeted at developers on all platforms. They are talking about adding enough serious IDE power over time (and the original VS shows that they know what it takes) that they could become a serious power in the open, cross-platform dev world.

They would not need to port all the Windows-specific functionality that has accreted on Visual Studio over the years to become the "new Visual Studio" for developers on all platforms.


We released an C/C++ extension for VS Code today as well. https://blogs.msdn.microsoft.com/vcblog/2016/03/31/cc-extens...


Not necessarily. Getting it to work with Wine is probably easier.

I've spent many hours running Publisher in CrossOver Office and never ran into any problems, so this sort of thing is certainly possible for complex apps.


I'm using CLion + Cygwin for this now. Works nicely, even gdb, without remote machines. http://stackoverflow.com/questions/33267305/how-to-setup-cli...


I have to say this is awesome. Not gonna make me jump ship from Mac but I love that MSFT is finally making steps towards being very open source friendly.


Was thinking earlier today – after reading this – that Windows is one step closer to becoming a viable alternative to OS X for a development box. Lately I've been getting more and more glitches with OS X (for example a text input glitched up and started shifting letters oddly, I suspect some kind of utf16/utf8 accidentally got confused). Someday in the not to far future it may be time to look into switching, and well, native linux apps just might make it feasible.


are you sure about this? MS has never been friendly to open source, the recent crazy moves from its side may just be a Troy thing, sorry I just could not trust M$ as history is the best teacher.

I feel MS is forcefully getting into OSS ground and may damage the freedom we have enjoyed. Anyway I have no interests in anything it's doing. No trust, no anything. I just hope it will not use patent or something it is trying to leverage now to sue anyone it wants later, after all it has deep pockets and it is never an ethical company per se.


I am aware of Microsoft's history, and I am fairly certain that Microsoft changed behavior towards the FLOSS community is not out of love for free software.

But Microsoft must have, over time, tried nearly every single dirty trick in their playbook against Linux/FLOSS, and none of that really worked. Short of taking out a hit on Linus Torvalds, there is little they can do to keep people from using Linux (and even that would not really help).

And in the face of this situation, the attitude at Microsoft now seems to be, "if they are going to run Linux on the server, at least we want them to use our cloud to host those servers, and our development tools for building their applications". They may do so only because they have no other choice, but so what? The olden days where Microsoft utterly dominated the IT landscape or developer tools are gone and unlikely to come back. Microsoft wants to stay relevant, so they go with the flow.


> The olden days where Microsoft utterly dominated the IT landscape or developer tools are gone and unlikely to come back.

Well, if all these plans to 'embrace Linux' succeed they might come back after all. And what happens after that is anybody's guess.

Microsoft is clearly aiming for a much stronger presence in the server market than what they achieved to date and targeting developers on the systems that build for that server market is a smart move.


> I feel MS is forcefully getting into OSS ground and may damage the freedom we have enjoyed.

And how exactly are they going to do that? The last I checked, I could download a distro that was completely independent of anything related to Microsoft. I could even get something like gNewSense and not deal with any nonfree software. Hell, if I was REALLY dedicated to .NET, I could just fork Rosyln. It's Apache 2.0 license after all.

Seriously, I don't think Microsoft is going to make Windows free and join the FSF anytime, but I think they've recognized that they do need to increase their support on Linux if they want to remain relevant going forward. This is a strategic business decision based on industry trend.

People need to exercise some critical thinking skills here. Microsoft is reacting and responding to industry trends to ensure it remains profitable. Just like every other business out there.



Anyone who downvotes replies like this is displaying ignorance of Microsoft's pattern of behavior through their entire history.

Sure, maybe it's different this time ... But usually it isn't.


http://www.hanselman.com/blog/MicrosoftKilledMyPappy.aspx

Seriously, when was the last time Microsoft employed EEE? People have been saying "maybe it's different this time.." for years. I'm getting sick of seeing the "EEE" meme every time Microsoft does something.


It seems like this reply would be more appropriate when attached to BoysenberryPi's comment.

1) There's much more to Microsoft's historical bad behavior than EEE.

2) Noone in this sub-thread invoked EEE.

:)


It may have been more appropriate to the thread above or the sibling, but I was one who downvoted the original so I wanted to respond to the calling out.

Whether or not EEE was specifically invoked is sort of irrelevant, the implications (trojan horse of Troy) were clear to me.

There have been 3 submissions today about Microsoft and the same EEE trope has been posted multiple times to each one. it adds nothing but noise to the conversation when Microsofts behaviour, especially in the last 3-4 years, has not been terrible.


> Whether or not EEE was specifically invoked is sort of irrelevant...

By responding to a point that hasn't even been raised, you add noise to the conversation. It would have been substantially more useful (and injected signal into the discussion) to address the points that either jblow or ausjke raised.


A random example from google: anti-open-document lobbying.

http://www.theinquirer.net/inquirer/news/2330040/microsoft-c...


It seriously helps when citing articles like this you actually take the time to read the proposal and the response. The British gov't was proposing to move to only ODF to the exclusion of OOXML.

Here's a quote from the blog post:

"To be very clear, we are not calling for the government to drop its proposal to use ODF. Nor are we calling for it to use only Open XML. What we are saying is that the government include BOTH Open XML and ODF."

I'm not sure how that's considered "anti-open-document lobbying". Especially since every version of Office from 2007 has had support for ODF.


That's not EEE, that's Microsoft trying to convince an important customer to keep buying their office suite. What a crime!


Thanks for the article. My gradual transition to MS from Mac became a lot easier when I realized that MS was indicted for things that Apple does routinely in both their OSes these days. MS's very success worked against them.


> Anyone who downvotes replies like this is displaying ignorance of Microsoft's pattern of behavior through their entire history.

And you, like many people are overplaying the power Microsoft has in order to play your own game of FUD. They has a lot less power than you realize. How can they even possible extinguish Linux? Even if they somehow make gov't all over the world use Windows server, that won't stop individuals and organizations from using Apache and nginx. Their own compiler for .NET is Apache 2.0 License. What are they going to do? Exercise some copyright law?


I'm habitually downvoting any comment that includes the string "M$".

There is no clearer sign of ill will towards other participants (not Microsoft!) and no readiness to engage in a civil, fact-based discussion.


Been doing the same for about a decade. The whole M$/Micro$oft thing is fucking childish.

And I'm a FreeBSD user...so it's not like I'm against FOSS.


OK, I'll be considering using this for LibreOffice development.

Microsoft finally got their mojo back? They are getting amazing.


I'm on this team, and wrote the post. I'd love to hear how this works out for you.

And yes, it's all mojo all the time around here these days. :)


I'll have to dust off my Windows laptop - good on you guys :-) Even if we are competing against your Office suite!


Haha, there is a certain irony to this comment for me. Microsoft office is one of the few Microsoft technologies I find I can't do without. That said I hope one day LibreOffice will mean I no longer have to rely on MS Office.


Whats the mentality here? "If Linux is just an app you run on Windows, we can become relevant again to all those people"?


There are a lot of people in the world that do cross platform development so we're improving our tooling story for them. Well, I hope we are. It's also important to us to have a good IoT development story, and any thing that can run Linux will run Linux.


I think this is great. I'd be very glad if this can be used for web development like many folks use OSX nowadays.


We'd be very interested to hear how this is working out for folks doing C/C++ web development


You DO know who you work for, right?

No matter what good you believe you're doing, it's just in the end going to be used to extinguish competition.


It seems like Microsoft has pivoted to be a cloud, services, and dev tools company. They no longer expect revenue growth from Windows. In that context the best strategy is open-source and support everything.... Exactly what they seem to be doing.


If Microsoft is a competitor to Apple, its doing a good thing IMO.


I'm not so sure about that. I think Microsoft have realised finally that competition is good, and actually you can make a lot of money out of services. If you extinguish competition, then you can't sell so many services.

At least, I hope that's what they have realised :-)


lol, are you new to capitalism?


I'm barely picking up the pieces of my blown mind from the "bash running on a Linux image inside Windows" announcement and now... this?

Are you trying to kill me, Microsoft?


Will the new VS Linux development stuff work for the newly announced "Linux ABI for Windows" too?

[disclosure: MSFT]


We're aware of that work of course but haven't tried anything with it yet. We were really focused on the remote compile. Since we only support remote right now to try it you’d have to setup an ssh connection to yourself. Hmmm...

Anyway, I'm very interested in how can we leverage Linux tools locally on Windows as part of this.


Yeah, I want to develop for WSL from Visual C++ on Linux running under WSL.

...What a time to be alive. Did hell freeze over or something?


Been using visualgdb for this. Intellisense, debugging and all other stuff. Works both for desktop linux and cross-compiling for embedded devices.

Hope those guys don't go out of business... They were really helpful


Kinda already exists: http://visualgdb.com/toolchains/embedded just use the existing x86 target. You're really just using MSVC as a fancy text editor.


Not only editor. VS has extensive debugging facilities. You only need to write glue code between VS and GDB like "VS asks what's inside variable X", or "GDB hit breakpoint, here's the stack trace".

Source: I have written a Nodejs debugger for VS before MS released their NodeTools to the public. If you have a couple of such great tools (VS+v8 or VS+GDB) it is just a matter of time before someone brings them together.


I'm curious is it using MSBuild as the build system on a Linux machine, or does it integrate with existing makefile, CMake, autotools, etc. style projects? It seems like a total nonstarter to expect Linux developers to switch to MSBuild.


We are using msbuild to drive running the compile on the remote Linux machine. Today that is being emitted as straight commands for gcc on Linux. We're interested in what we should do around make, cmake, etc. This is just a start.


I'd highly recommend contributing back "build features" to projects like cmake if it doesn't already exist so that you can simply enable a feature rather than hard-coding gcc-specific flags. Even something like clang takes a little work to shoehorn into a project that is enabling many gcc specific features. Abstracting the feature out means compiler front-ends don't have to mimic gcc to have a chance of working, and even allows more easily adapting to other POSIX platforms where gcc/clang are not the default compilers. E.g. if cmake doesn't support a robust enough way to specify LTO the way you need to in a project, consider helping add it. (Just picked some random feature)


Good point, if needed I'm sure we will.


Please tell me that msbuild has a replacement in the wings? Something capable of hermetic reproducible builds. PLEASE???


It wasn't clear to me either. Unfortunately, the extension seems to have a dependency on the Android NDK which I don't plan to install:

  Today we do have a dependency on the Android Tools for Visual Studio


The NDK dependency is actually to get the MIEngine that provides the machine interface to hook up GDB with the VS debugger. We're looking at making the MIEngine a separate component so the Android, iOS and Linux tools don't have a dependency on each other.


Had to boot Linux to expand my NTFS partition to have enough space to install it all - hoping it's something for Update 3 or before.


Oh weird, huh this must be more fallout from the canceling of Astoria that they're spinning off into a standalone thing.


I think it builds it on the system since they have you install g++ and gdb probably for debugging. That's the impression I get, not entirely sure though. So it probably transfers your code via SSH and then runs it.


It's not super clear but I think that step is actually installing g++, etc. on the Linux host (and in reality they probably mean you should apt-get install build-essential and not just g++, gdb, etc. individually). It's having you install openssh-server which wouldn't really make sense on the client/development PC. Also for ARM you'd need a gcc cross compiler installed and I didn't see any mention of that.


The dependencies mentioned are for the remote Linux machine you connect to from VS. We use ssh from within VS to copy files across and issue the compilation commands with gcc. There isn't any cross compilation right now even for ARM. Most of our testing here has been on Raspberry Pis.


the ssh server is indeed for the remote machine/Linux only, we are working on a prerequisites check with possible automatic acquisition of those tools on Linux if you do not have them installed; ARM on x86 or x64 and x86 on x64 it's not a sscenario we currently support, but x86 on x64 would be the first thing we look at


I meant exactly what you said, they install the compiler and tool set on the Linux host, the Windows end just SSH's into it and sends the code / commands. That is my speculation at least.


That's it exactly


I really hope windows runs on linux some day. I've always liked the windows shell. This might seem out of place on this post, but I get the sense that MS is putting more effort into linux.


I think everyone can agree that Microsoft is really embracing GNU+Linux these days.


extend


Nice power-play for the IoT market, especially considering that Microsoft is very much an also-ran at this moment, vis a vis shipping actual Microsoft-licensed code in user binaries in IoT-class devices ..

However, this will not lure me away from PlatformIO and SublimeText, which are perfectly cromulate IoT developer tools ..


I love platformio too. We have another extension that can be used with platformio. This isn't really documented yet, something I'll be fixing next month. https://visualstudiogallery.msdn.microsoft.com/35dbae07-8c1a...


Hrmm, now I'm starting to feel a bit courted here, but alas .. no .. I just will never turn to Microsoft for tooling in the IoT/embedded space.

There is far too much 'bad aji', if you know what that is .. in the way that Microsoft is handling all of this. You are proving a bitter point, for those of us who have been watching for 30 or so years, which is this: Microsoft is still up to its old tricks.

So, no thanks..


It's nice to see MS competing again. Too bad the other hand is doubling-down on the spying.


> Today we only support building remotely on the Linux target machine.

That's not quite what I suspected this meant.

Buuuut, still -- good for you, Microsoft. These are the kinds of changes you need in order to attract developers.


I've been puzzling over this all night. I think I finally got your meaning. I have an IoT focus so "target" doesn't have a negative connotation to me. :)


Well, it's not necessarily negative, but the scope of the feature delivered is much smaller if what the team says they've done is integrated ssh/scp/gdb into VC++.

When I read the headline after having read the bit about native linux binaries, I thought "wowsers MS went full linux support!" Still, it's an excellent achievement and it seems clear that they wanted to announce this at the same time. They right-sized the scope of the VC++ work to match what could be accomplished in the time allowed.

I would be thrilled if Microsoft's next move would be to transition to an LLVM/clang based engine underneath VC++. IMO their distinguishing feature for VC++ is not the compiler engine. This would be the kind of lean maneuver that they're trying to steer towards these days.


Sorry, never meant to mislead that VS was on Linux.

Is this the sort of thing you are looking for with respect to clang? https://blogs.msdn.microsoft.com/vcblog/2016/01/20/clang-wit...

We don't have clang support for Linux yet, something we are looking at. Lots to do. :)


I was hoping this was an extension for VS:Code. Love the IDE and the clang extension is decent....but real support would be pretty sweet.



Finally... Hope MS will also port Office to Linux;


Mmmh. I use MS Office at work because I have to, but I really don't like it. Office 2013 has given me more headaches than 2003, 2007 and 2010 combined. So personally, I hope they don't.

Of course, if MS Office was available on Linux, converting regular users would be so much easier... But for the time being, I don't see it happening. It would probably be a lot of work, and the demand probably is not there. Last time I saw any numbers, desktop machines in western Europe ran about 90% Windows, 7-8% OS X, and ~1.5% Linux. So unless porting Office to Linux happens to be trivial (which I doubt), it is not worth the effort at this time. (OTOH, they did port it to iOS and Android, so it cannot be impossible, either.)


Lame, April Fools isn't till tomorrow.

Wait, for real?


Does this mean, Games developers can now recompile their games for linux?


Not if they target Windows only libraries, ie DirectX. It would probably be about as much effort as it is today -- only their compile/deploy is more streamline if I understand the post correctly.


OK, this seems pretty cool.

I hope Microsoft has fixed a few of these things though: http://goldmanosi.blogspot.com/2012/05/visual-studio-is-it-g...


posted in 2012. have you even tried the latest visual studio?


Why? Please.. Microsoft is dying. Do not disturb.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: